| 946 | # appear on the stack. |
| 947 | |
| 948 | class StackObject(object): |
| 949 | __slots__ = ( |
| 950 | # name of descriptor record, for info only |
| 951 | 'name', |
| 952 | |
| 953 | # type of object, or tuple of type objects (meaning the object can |
| 954 | # be of any type in the tuple) |
| 955 | 'obtype', |
| 956 | |
| 957 | # human-readable docs for this kind of stack object; a string |
| 958 | 'doc', |
| 959 | ) |
| 960 | |
| 961 | def __init__(self, name, obtype, doc): |
| 962 | assert isinstance(name, str) |
| 963 | self.name = name |
| 964 | |
| 965 | assert isinstance(obtype, type) or isinstance(obtype, tuple) |
| 966 | if isinstance(obtype, tuple): |
| 967 | for contained in obtype: |
| 968 | assert isinstance(contained, type) |
| 969 | self.obtype = obtype |
| 970 | |
| 971 | assert isinstance(doc, str) |
| 972 | self.doc = doc |
| 973 | |
| 974 | def __repr__(self): |
| 975 | return self.name |
| 976 | |
| 977 | |
| 978 | pyint = pylong = StackObject( |
no outgoing calls
no test coverage detected
searching dependent graphs…