diff options
author | ?ukasz Langa <lukasz@langa.pl> | 2013-07-02 10:28:51 +0200 |
---|---|---|
committer | ?ukasz Langa <lukasz@langa.pl> | 2013-07-02 10:28:51 +0200 |
commit | 2841142ce382e70b664a3e2071427a3e11cdeb44 (patch) | |
tree | 6065230bcbd33f628bab4cf3e15c4fc03a0dedc9 /singledispatch_helpers.py | |
parent | 005e4d4b44bf259e5c748b6dad3f79d478773994 (diff) | |
download | singledispatch-2841142ce382e70b664a3e2071427a3e11cdeb44.tar.gz |
update to the ref implementation as of 02-July-2013:
* more predictable dispatch thanks to C3-based linearization for ABC support
* improved tests and docstrings
Diffstat (limited to 'singledispatch_helpers.py')
-rw-r--r-- | singledispatch_helpers.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/singledispatch_helpers.py b/singledispatch_helpers.py index 5c4aa8b..3a71831 100644 --- a/singledispatch_helpers.py +++ b/singledispatch_helpers.py @@ -8,6 +8,7 @@ from __future__ import unicode_literals from abc import ABCMeta from collections import MutableMapping, UserDict +import sys try: from thread import get_ident except ImportError: @@ -148,3 +149,14 @@ class MappingProxyType(UserDict): def get_cache_token(): return ABCMeta._abc_invalidation_counter + + + +class Support(object): + def dummy(self): + pass + + def cpython_only(self, func): + if 'PyPy' in sys.version: + return self.dummy + return func |