|
17 | 17 | 'is_', 'is_not', 'isub', 'itemgetter', 'itruediv', 'ixor', 'le', |
18 | 18 | 'length_hint', 'lshift', 'lt', 'matmul', 'methodcaller', 'mod', |
19 | 19 | 'mul', 'ne', 'neg', 'not_', 'or_', 'pos', 'pow', 'rshift', |
20 | | - 'setitem', 'sub', 'subscript', 'truediv', 'truth', 'xor'] |
| 20 | + 'setitem', 'sub', 'truediv', 'truth', 'xor'] |
21 | 21 |
|
22 | 22 | from builtins import abs as _abs |
23 | 23 |
|
@@ -408,32 +408,6 @@ def ixor(a, b): |
408 | 408 | return a |
409 | 409 |
|
410 | 410 |
|
411 | | -@object.__new__ # create a singleton instance |
412 | | -class subscript: |
413 | | - """ |
414 | | - A helper to turn subscript notation into indexing objects. This can be |
415 | | - used to create item access patterns ahead of time to pass them into |
416 | | - various subscriptable objects. |
417 | | -
|
418 | | - For example: |
419 | | - subscript[5] == 5 |
420 | | - subscript[3:7:2] == slice(3, 7, 2) |
421 | | - subscript[5, 8] == (5, 8) |
422 | | - """ |
423 | | - __slots__ = () |
424 | | - |
425 | | - def __new__(cls): |
426 | | - raise TypeError("cannot create '{}' instances".format(cls.__name__)) |
427 | | - |
428 | | - @staticmethod |
429 | | - def __getitem__(key): |
430 | | - return key |
431 | | - |
432 | | - @staticmethod |
433 | | - def __reduce__(): |
434 | | - return 'subscript' |
435 | | - |
436 | | - |
437 | 411 | try: |
438 | 412 | from _operator import * |
439 | 413 | except ImportError: |
|
0 commit comments