| 1 | from pypy.interpreter.mixedmodule import MixedModule |
| 2 | |
| 3 | class Module(MixedModule): |
| 4 | """Operator Builtin Module. """ |
| 5 | applevel_name = '_operator' |
| 6 | |
| 7 | appleveldefs = {} |
| 8 | app_names = ['countOf', 'attrgetter', 'itemgetter', 'methodcaller'] |
| 9 | for name in app_names: |
| 10 | appleveldefs[name] = 'app_operator.%s' % name |
| 11 | |
| 12 | interp_names = ['index', 'abs', 'add', 'and_', |
| 13 | 'concat', 'contains', 'delitem', 'eq', 'floordiv', |
| 14 | 'ge', 'getitem', 'gt', 'inv', |
| 15 | 'invert', 'is_', 'is_not', |
| 16 | 'le', 'lshift', 'lt', 'mod', 'mul', |
| 17 | 'ne', 'neg', 'not_', 'or_', |
| 18 | 'pos', 'pow', 'rshift', 'setitem', |
| 19 | 'sub', 'truediv', 'matmul', 'truth', 'xor', |
| 20 | 'iadd', 'iand', 'iconcat', 'ifloordiv', |
| 21 | 'ilshift', 'imod', 'imul', 'ior', 'ipow', |
| 22 | 'irshift', 'isub', 'itruediv', 'imatmul', 'ixor', |
| 23 | 'length_hint', 'indexOf'] |
| 24 | |
| 25 | interpleveldefs = { |
| 26 | '_compare_digest': 'tscmp.compare_digest', |
| 27 | } |
| 28 | |
| 29 | for name in interp_names: |
| 30 | interpleveldefs[name] = 'interp_operator.%s' % name |