You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Start Python3 slices. Split off token routine.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from uncompyle6 import PYTHON3
|
||||
from uncompyle6.scanners.tok import NoneToken
|
||||
|
||||
if PYTHON3:
|
||||
intern = sys.intern
|
||||
@@ -13,6 +14,11 @@ class AST(UserList):
|
||||
self.type = intern(type)
|
||||
UserList.__init__(self, kids)
|
||||
|
||||
def isNone(self):
|
||||
"""An AST None token. We can't use regular list comparisons
|
||||
because AST token offsets might be different"""
|
||||
return len(self.data) == 1 and self.data[0] == NoneToken
|
||||
|
||||
def __getslice__(self, low, high): return self.data[low:high]
|
||||
|
||||
def __eq__(self, o):
|
||||
|
Reference in New Issue
Block a user