{"modulePath":"github.com/go-python/gpython","version":"v0.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package py\n\nFunction objects\n\nFunction objects and code objects should not be confused with each other:\n\nFunction objects are created by the execution of the 'def' statement. They reference a code object in their \\_\\_code\\_\\_ attribute, which is a purely syntactic object, i.e. nothing more than a compiled version of some source code lines.  There is one code object per source code \"fragment\", but each code object can be referenced by zero or many function objects depending only on how many times the 'def' statement in the source was executed so far.\n\nPython global definitions\n\n## Constants\n\n```go\nconst (\n\t// Masks for flags above\n\tCO_OPTIMIZED   = 0x0001\n\tCO_NEWLOCALS   = 0x0002\n\tCO_VARARGS     = 0x0004\n\tCO_VARKEYWORDS = 0x0008\n\tCO_NESTED      = 0x0010\n\tCO_GENERATOR   = 0x0020\n\n\tCO_NOFREE                  = 0x0040\n\tCO_GENERATOR_ALLOWED       = 0x1000\n\tCO_FUTURE_DIVISION         = 0x2000\n\tCO_FUTURE_ABSOLUTE_IMPORT  = 0x4000 // do absolute imports by default\n\tCO_FUTURE_WITH_STATEMENT   = 0x8000\n\tCO_FUTURE_PRINT_FUNCTION   = 0x10000\n\tCO_FUTURE_UNICODE_LITERALS = 0x20000\n\tCO_FUTURE_BARRY_AS_BDFL    = 0x40000\n\n\tCO_COMPILER_FLAGS_MASK = CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL\n\n\t// This value is found in the cell2arg array when the\n\t// associated cell variable does not correspond to an\n\t// argument. The maximum number of arguments is 255 (indexed\n\t// up to 254), so 255 work as a special flag.\n\tCO_CELL_NOT_AN_ARG = 255\n\n\tCO_MAXBLOCKS = 20 // Max static block nesting within a function\n)\n```\n\n```go\nconst (\n\t// Maximum possible Int\n\tIntMax = math.MaxInt64\n\t// Minimum possible Int\n\tIntMin = math.MinInt64\n\n\t// Go integer limits\n\tGoUintMax = ^uint(0)\n\tGoUintMin = 0\n\tGoIntMax  = int(GoUintMax \u003e\u003e 1)\n\tGoIntMin  = -GoIntMax - 1\n)\n```\n\n```go\nconst (\n\n\t// The method will be passed the type object as the first parameter\n\t// rather than an instance of the type. This is used to create class\n\t// methods, similar to what is created when using the classmethod()\n\t// built-in function.\n\tMETH_CLASS = 0x0010\n\n\t// The method will be passed NULL as the first parameter rather than\n\t// an instance of the type. This is used to create static methods,\n\t// similar to what is created when using the staticmethod() built-in\n\t// function.\n\tMETH_STATIC = 0x0020\n\n\t// The method will be loaded in place of existing definitions. Without\n\t// METH_COEXIST, the default is to skip repeated definitions. Since\n\t// slot wrappers are loaded before the method table, the existence of\n\t// a sq_contains slot, for example, would generate a wrapped method\n\t// named __contains__() and preclude the loading of a corresponding\n\t// PyCFunction with the same name. With the flag defined, the\n\t// PyCFunction will be loaded in place of the wrapper object and will\n\t// co-exist with the slot. This is helpful because calls to\n\t// PyCFunctions are optimized more than wrapper object calls.\n\tMETH_COEXIST = 0x0040\n)\n```\n\n```go\nconst (\n\t// Set if the type object is dynamically allocated\n\tTPFLAGS_HEAPTYPE uint = 1 \u003c\u003c 9\n\n\t// Set if the type allows subclassing\n\tTPFLAGS_BASETYPE uint = 1 \u003c\u003c 10\n\n\t// Set if the type is 'ready' -- fully initialized\n\tTPFLAGS_READY uint = 1 \u003c\u003c 12\n\n\t// Set while the type is being 'readied', to prevent recursive ready calls\n\tTPFLAGS_READYING uint = 1 \u003c\u003c 13\n\n\t// Objects support garbage collection (see objimp.h)\n\tTPFLAGS_HAVE_GC uint = 1 \u003c\u003c 14\n\n\t// Objects support type attribute cache\n\tTPFLAGS_HAVE_VERSION_TAG  uint = 1 \u003c\u003c 18\n\tTPFLAGS_VALID_VERSION_TAG uint = 1 \u003c\u003c 19\n\n\t// Type is abstract and cannot be instantiated\n\tTPFLAGS_IS_ABSTRACT uint = 1 \u003c\u003c 20\n\n\t// These flags are used to determine if a type is a subclass.\n\tTPFLAGS_INT_SUBCLASS      uint = 1 \u003c\u003c 23\n\tTPFLAGS_LONG_SUBCLASS     uint = 1 \u003c\u003c 24\n\tTPFLAGS_LIST_SUBCLASS     uint = 1 \u003c\u003c 25\n\tTPFLAGS_TUPLE_SUBCLASS    uint = 1 \u003c\u003c 26\n\tTPFLAGS_BYTES_SUBCLASS    uint = 1 \u003c\u003c 27\n\tTPFLAGS_UNICODE_SUBCLASS  uint = 1 \u003c\u003c 28\n\tTPFLAGS_DICT_SUBCLASS     uint = 1 \u003c\u003c 29\n\tTPFLAGS_BASE_EXC_SUBCLASS uint = 1 \u003c\u003c 30\n\tTPFLAGS_TYPE_SUBCLASS     uint = 1 \u003c\u003c 31\n\n\tTPFLAGS_DEFAULT = TPFLAGS_HAVE_VERSION_TAG\n)\n```\n\n```go\nconst NAME_CHARS = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\"\n```\n\n## Variables\n\n```go\nvar (\n\tBoolType = NewType(\"bool\", \"bool(x) -\u003e bool\\n\\nReturns True when the argument x is true, False otherwise.\\nThe builtins True and False are the only two instances of the class bool.\\nThe class bool is a subclass of the class int, and cannot be subclassed.\")\n\t// Some well known bools\n\tFalse = Bool(false)\n\tTrue  = Bool(true)\n)\n```\n\n```go\nvar (\n\tStringDictType = NewTypeX(\"dict\", dictDoc, DictNew, nil)\n\tDictType       = NewType(\"dict\", dictDoc)\n)\n```\n\n```go\nvar (\n\tEllipsisTypeType = NewType(\"EllipsisType\", \"\")\n\tEllipsis         = EllipsisType(struct{}{})\n)\n```\n\n```go\nvar (\n\t// Exception heirachy\n\tBaseException             = ObjectType.NewTypeFlags(\"BaseException\", \"Common base class for all exceptions\", ExceptionNew, nil, ObjectType.Flags|TPFLAGS_BASE_EXC_SUBCLASS)\n\tSystemExit                = BaseException.NewType(\"SystemExit\", \"Request to exit from the interpreter.\", nil, nil)\n\tKeyboardInterrupt         = BaseException.NewType(\"KeyboardInterrupt\", \"Program interrupted by user.\", nil, nil)\n\tGeneratorExit             = BaseException.NewType(\"GeneratorExit\", \"Request that a generator exit.\", nil, nil)\n\tExceptionType             = BaseException.NewType(\"Exception\", \"Common base class for all non-exit exceptions.\", nil, nil)\n\tStopIteration             = ExceptionType.NewType(\"StopIteration\", \"Signal the end from iterator.__next__().\", nil, nil)\n\tArithmeticError           = ExceptionType.NewType(\"ArithmeticError\", \"Base class for arithmetic errors.\", nil, nil)\n\tFloatingPointError        = ArithmeticError.NewType(\"FloatingPointError\", \"Floating point operation failed.\", nil, nil)\n\tOverflowError             = ArithmeticError.NewType(\"OverflowError\", \"Result too large to be represented.\", nil, nil)\n\tZeroDivisionError         = ArithmeticError.NewType(\"ZeroDivisionError\", \"Second argument to a division or modulo operation was zero.\", nil, nil)\n\tAssertionError            = ExceptionType.NewType(\"AssertionError\", \"Assertion failed.\", nil, nil)\n\tAttributeError            = ExceptionType.NewType(\"AttributeError\", \"Attribute not found.\", nil, nil)\n\tBufferError               = ExceptionType.NewType(\"BufferError\", \"Buffer error.\", nil, nil)\n\tEOFError                  = ExceptionType.NewType(\"EOFError\", \"Read beyond end of file.\", nil, nil)\n\tImportError               = ExceptionType.NewType(\"ImportError\", \"Import can't find module, or can't find name in module.\", nil, nil)\n\tLookupError               = ExceptionType.NewType(\"LookupError\", \"Base class for lookup errors.\", nil, nil)\n\tIndexError                = LookupError.NewType(\"IndexError\", \"Sequence index out of range.\", nil, nil)\n\tKeyError                  = LookupError.NewType(\"KeyError\", \"Mapping key not found.\", nil, nil)\n\tMemoryError               = ExceptionType.NewType(\"MemoryError\", \"Out of memory.\", nil, nil)\n\tNameError                 = ExceptionType.NewType(\"NameError\", \"Name not found globally.\", nil, nil)\n\tUnboundLocalError         = NameError.NewType(\"UnboundLocalError\", \"Local name referenced but not bound to a value.\", nil, nil)\n\tOSError                   = ExceptionType.NewType(\"OSError\", \"Base class for I/O related errors.\", nil, nil)\n\tBlockingIOError           = OSError.NewType(\"BlockingIOError\", \"I/O operation would block.\", nil, nil)\n\tChildProcessError         = OSError.NewType(\"ChildProcessError\", \"Child process error.\", nil, nil)\n\tConnectionError           = OSError.NewType(\"ConnectionError\", \"Connection error.\", nil, nil)\n\tBrokenPipeError           = ConnectionError.NewType(\"BrokenPipeError\", \"Broken pipe.\", nil, nil)\n\tConnectionAbortedError    = ConnectionError.NewType(\"ConnectionAbortedError\", \"Connection aborted.\", nil, nil)\n\tConnectionRefusedError    = ConnectionError.NewType(\"ConnectionRefusedError\", \"Connection refused.\", nil, nil)\n\tConnectionResetError      = ConnectionError.NewType(\"ConnectionResetError\", \"Connection reset.\", nil, nil)\n\tFileExistsError           = OSError.NewType(\"FileExistsError\", \"File already exists.\", nil, nil)\n\tFileNotFoundError         = OSError.NewType(\"FileNotFoundError\", \"File not found.\", nil, nil)\n\tInterruptedError          = OSError.NewType(\"InterruptedError\", \"Interrupted by signal.\", nil, nil)\n\tIsADirectoryError         = OSError.NewType(\"IsADirectoryError\", \"Operation doesn't work on directories.\", nil, nil)\n\tNotADirectoryError        = OSError.NewType(\"NotADirectoryError\", \"Operation only works on directories.\", nil, nil)\n\tPermissionError           = OSError.NewType(\"PermissionError\", \"Not enough permissions.\", nil, nil)\n\tProcessLookupError        = OSError.NewType(\"ProcessLookupError\", \"Process not found.\", nil, nil)\n\tTimeoutError              = OSError.NewType(\"TimeoutError\", \"Timeout expired.\", nil, nil)\n\tReferenceError            = ExceptionType.NewType(\"ReferenceError\", \"Weak ref proxy used after referent went away.\", nil, nil)\n\tRuntimeError              = ExceptionType.NewType(\"RuntimeError\", \"Unspecified run-time error.\", nil, nil)\n\tNotImplementedError       = RuntimeError.NewType(\"NotImplementedError\", \"Method or function hasn't been implemented yet.\", nil, nil)\n\tSyntaxError               = ExceptionType.NewType(\"SyntaxError\", \"Invalid syntax.\", nil, nil)\n\tIndentationError          = SyntaxError.NewType(\"IndentationError\", \"Improper indentation.\", nil, nil)\n\tTabError                  = IndentationError.NewType(\"TabError\", \"Improper mixture of spaces and tabs.\", nil, nil)\n\tSystemError               = ExceptionType.NewType(\"SystemError\", \"Internal error in the Gpython interpreter.\\n\\nPlease report this to the Gpython maintainer, along with the traceback,\\nthe Gpython version, and the hardware/OS platform and version.\", nil, nil)\n\tTypeError                 = ExceptionType.NewType(\"TypeError\", \"Inappropriate argument type.\", nil, nil)\n\tValueError                = ExceptionType.NewType(\"ValueError\", \"Inappropriate argument value (of correct type).\", nil, nil)\n\tUnicodeError              = ValueError.NewType(\"UnicodeError\", \"Unicode related error.\", nil, nil)\n\tUnicodeDecodeError        = UnicodeError.NewType(\"UnicodeDecodeError\", \"Unicode decoding error.\", nil, nil)\n\tUnicodeEncodeError        = UnicodeError.NewType(\"UnicodeEncodeError\", \"Unicode encoding error.\", nil, nil)\n\tUnicodeTranslateError     = UnicodeError.NewType(\"UnicodeTranslateError\", \"Unicode translation error.\", nil, nil)\n\tWarning                   = ExceptionType.NewType(\"Warning\", \"Base class for warning categories.\", nil, nil)\n\tDeprecationWarning        = Warning.NewType(\"DeprecationWarning\", \"Base class for warnings about deprecated features.\", nil, nil)\n\tPendingDeprecationWarning = Warning.NewType(\"PendingDeprecationWarning\", \"Base class for warnings about features which will be deprecated\\nin the future.\", nil, nil)\n\tRuntimeWarning            = Warning.NewType(\"RuntimeWarning\", \"Base class for warnings about dubious runtime behavior.\", nil, nil)\n\tSyntaxWarning             = Warning.NewType(\"SyntaxWarning\", \"Base class for warnings about dubious syntax.\", nil, nil)\n\tUserWarning               = Warning.NewType(\"UserWarning\", \"Base class for warnings generated by user code.\", nil, nil)\n\tFutureWarning             = Warning.NewType(\"FutureWarning\", \"Base class for warnings about constructs that will change semantically\\nin the future.\", nil, nil)\n\tImportWarning             = Warning.NewType(\"ImportWarning\", \"Base class for warnings about probable mistakes in module imports\", nil, nil)\n\tUnicodeWarning            = Warning.NewType(\"UnicodeWarning\", \"Base class for warnings about Unicode related problems, mostly\\nrelated to conversion problems.\", nil, nil)\n\tBytesWarning              = Warning.NewType(\"BytesWarning\", \"Base class for warnings about bytes and buffer related problems, mostly\\nrelated to conversion from str or comparing to str.\", nil, nil)\n\tResourceWarning           = Warning.NewType(\"ResourceWarning\", \"Base class for warnings about resource usage.\", nil, nil)\n\t// Singleton exceptions\n\tNotImplemented Object\n)\n```\n\n```go\nvar (\n\tNoneTypeType = NewType(\"NoneType\", \"\")\n\t// And the ubiquitous\n\tNone = NoneType(struct{}{})\n)\n```\n\n```go\nvar (\n\t// Set in vm/eval.go - to avoid circular import\n\tVmEvalCode func(ctx Context, code *Code, globals, locals StringDict, args []Object, kws StringDict, defs []Object, kwdefs StringDict, closure Tuple) (retval Object, err error)\n\tVmRunFrame func(frame *Frame) (res Object, err error)\n)\n```\n\n```go\nvar (\n\t// DefaultContextOpts should be the default opts created for py.NewContext.\n\t// Calling this ensure that you future proof you code for suggested/default settings.\n\tDefaultContextOpts = func() ContextOpts {\n\t\topts := ContextOpts{\n\t\t\tSysPaths: DefaultCoreSysPaths,\n\t\t}\n\t\topts.SysPaths = append(opts.SysPaths, DefaultAuxSysPaths...)\n\t\treturn opts\n\t}\n\n\t// NewContext is a high-level call to create a new gpython interpreter context.\n\t// See type Context interface.\n\tNewContext func(opts ContextOpts) Context\n\n\t// Compiles a python buffer into a py.Code object.\n\t// Returns a py.Code object or otherwise an error.\n\tCompile func(src, srcDesc string, mode CompileMode, flags int, dont_inherit bool) (*Code, error)\n)\n```\n\n```go\nvar BigIntType = NewType(\"bigint\", \"Holds large integers\")\n```\n\n```go\nvar BoundMethodType = NewType(\"boundmethod\", \"boundmethod object\")\n```\n\n```go\nvar BytesType = ObjectType.NewType(\"bytes\",\n\t`bytes(iterable_of_ints) -\u003e bytes\nbytes(string, encoding[, errors]) -\u003e bytes\nbytes(bytes_or_buffer) -\u003e immutable copy of bytes_or_buffer\nbytes(int) -\u003e bytes object of size given by the parameter initialized with null bytes\nbytes() -\u003e empty bytes object\n\nConstruct an immutable array of bytes from:\n  - an iterable yielding integers in range(256)\n  - a text string encoded using the specified encoding\n  - any object implementing the buffer API.\n  - an integer`, BytesNew, nil)\n```\n\n```go\nvar CallIteratorType = NewType(\"callable_iterator\", \"callable_iterator type\")\n```\n\n```go\nvar CellType = NewType(\"cell\", \"cell object\")\n```\n\n```go\nvar ClassMethodType = ObjectType.NewType(\"classmethod\",\n\t`classmethod(function) -\u003e method\n\nConvert a function to be a class method.\n\nA class method receives the class as implicit first argument,\njust like an instance method receives the instance.\nTo declare a class method, use this idiom:\n\n  class C:\n      def f(cls, arg1, arg2, ...): ...\n      f = classmethod(f)\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()).  The instance is ignored except for its class.\nIf a class method is called for a derived class, the derived class\nobject is passed as the implied first argument.\n\nClass methods are different than C++ or Java static methods.\nIf you want those, see the staticmethod builtin.`, ClassMethodNew, nil)\n```\n\n```go\nvar CodeType = NewType(\"code\", \"code(argcount, kwonlyargcount, nlocals, stacksize, flags, codestring,\\n      constants, names, varnames, filename, name, firstlineno,\\n      lnotab[, freevars[, cellvars]])\\n\\nCreate a code object.  Not for the faint of heart.\")\n```\n\n```go\nvar ComplexType = ObjectType.NewType(\"complex64\", \"complex(real[, imag]) -\u003e complex number\\n\\nCreate a complex number from a real part and an optional imaginary part.\\nThis is equivalent to (real + imag*1j) where imag defaults to 0.\", ComplexNew, nil)\n```\n\n```go\nvar DefaultAuxSysPaths = []string{\n\t\"/usr/lib/python3.4\",\n\t\"/usr/local/lib/python3.4/dist-packages\",\n\t\"/usr/lib/python3/dist-packages\",\n}\n```\nDefaultAuxSysPaths are secondary default search paths for module sys. This can be changed during runtime and plays nice with others using DefaultContextOpts() They are separated from the default core paths since they the more likley thing you will want to completely replace when using gpython.\n\n```go\nvar DefaultCoreSysPaths = []string{\n\t\".\",\n\t\"lib\",\n}\n```\nDefaultCoreSysPaths specify default search paths for module sys This can be changed during runtime and plays nice with others using DefaultContextOpts()\n\n```go\nvar EnumerateIteratorType = NewType(\"enumerate_iterator\", `enumerate_iterator object`)\n```\n\n```go\nvar EnumerateType = NewTypeX(\"enumerate\", `enumerate(iterable, start=0)\n\nReturn an enumerate object.`,\n\tEnumerateNew, nil)\n```\n\n```go\nvar (\n\tErrUnsupportedObjType = errors.New(\"unsupported obj type\")\n)\n```\n\n```go\nvar FileType = NewType(\"file\", `represents an open file`)\n```\n\n```go\nvar FilterType = NewTypeX(\"filter\", `filter(function or None, iterable) --\u003e filter object\n\nReturn an iterator yielding those items of iterable for which function(item)\nis true. If function is None, return the items that are true.`,\n\tFilterTypeNew, nil)\n```\n\n```go\nvar FloatType = ObjectType.NewType(\"float\", \"float(x) -\u003e floating point number\\n\\nConvert a string or number to a floating point number, if possible.\", FloatNew, nil)\n```\n\n```go\nvar FrameType = NewType(\"frame\", \"Represents a stack frame\")\n```\n\n```go\nvar FrozenSetType = NewType(\"frozenset\", \"frozenset() -\u003e empty frozenset object\\nfrozenset(iterable) -\u003e frozenset object\\n\\nBuild an immutable unordered collection of unique elements.\")\n```\n\n```go\nvar FunctionType = NewType(\"function\", \"A python function\")\n```\n\n```go\nvar GeneratorType = NewType(\"generator\", \"generator object\")\n```\n\n```go\nvar IntType = ObjectType.NewType(\"int\", `\nint(x=0) -\u003e integer\nint(x, base=10) -\u003e integer\n\nConvert a number or string to an integer, or return 0 if no arguments\nare given.  If x is a number, return x.__int__().  For floating point\nnumbers, this truncates towards zero.\n\nIf x is not a number or if base is given, then x must be a string,\nbytes, or bytearray instance representing an integer literal in the\ngiven base.  The literal can be preceded by '+' or '-' and be surrounded\nby whitespace.  The base defaults to 10.  Valid bases are 0 and 2-36.\nBase 0 means to interpret the base from the string as an integer literal.\n\u003e\u003e\u003e int('0b100', base=0)\n4`, IntNew, nil)\n```\n\n```go\nvar IteratorType = NewType(\"iterator\", \"iterator type\")\n```\n\n```go\nvar ListType = ObjectType.NewType(\"list\", \"list() -\u003e new empty list\\nlist(iterable) -\u003e new list initialized from iterable's items\", ListNew, nil)\n```\n\n```go\nvar MapType = NewTypeX(\"filter\", `map(func, *iterables) --\u003e map object\n\nMake an iterator that computes the function using arguments from\neach of the iterables.  Stops when the shortest iterable is exhausted.`,\n\tMapTypeNew, nil)\n```\n\n```go\nvar MethodType = NewType(\"method\", \"method object\")\n```\n\n```go\nvar ModuleType = NewType(\"module\", \"module object\")\n```\n\n```go\nvar ObjectType = \u0026Type{\n\tName:  \"object\",\n\tDoc:   \"The most base type\",\n\tFlags: TPFLAGS_BASETYPE,\n\tDict:  StringDict{},\n}\n```\n\n```go\nvar PropertyType = NewType(\"property\", \"property object\")\n```\n\n```go\nvar RangeIteratorType = NewType(\"range_iterator\", `range_iterator object`)\n```\n\n```go\nvar RangeType = NewTypeX(\"range\", `range(stop) -\u003e range object\nrange(start, stop[, step]) -\u003e range object\n\nReturn a virtual sequence of numbers from start to stop by step.`,\n\tRangeNew, nil)\n```\n\n```go\nvar SetType = NewTypeX(\"set\", \"set() -\u003e new empty set object\\nset(iterable) -\u003e new set object\\n\\nBuild an unordered collection of unique elements.\", SetNew, nil)\n```\n\n```go\nvar SliceType = NewTypeX(\"slice\", `slice(stop) -\u003e slice object\n\"slice(stop)\nslice(start, stop[, step])\n\nCreate a slice object.  This is used for extended slicing (e.g. a[0:10:2]).`, SliceNew, nil)\n```\n\n```go\nvar StaticMethodType = ObjectType.NewType(\"staticmethod\",\n\t`staticmethod(function) -\u003e method\n\nConvert a function to be a static method.\n\nA static method does not receive an implicit first argument.\nTo declare a static method, use this idiom:\n\n     class C:\n     def f(arg1, arg2, ...): ...\n     f = staticmethod(f)\n\nIt can be called either on the class (e.g. C.f()) or on an instance\n(e.g. C().f()).  The instance is ignored except for its class.\n\nStatic methods in Python are similar to those found in Java or C++.\nFor a more advanced concept, see the classmethod builtin.`, StaticMethodNew, nil)\n```\n\n```go\nvar StringType = ObjectType.NewType(\"str\",\n\t`str(object='') -\u003e str\nstr(bytes_or_buffer[, encoding[, errors]]) -\u003e str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.`, StrNew, nil)\n```\n\n```go\nvar TracebackType = NewType(\"traceback\", \"A python traceback\")\n```\n\n```go\nvar TupleType = ObjectType.NewType(\"tuple\", \"tuple() -\u003e empty tuple\\ntuple(iterable) -\u003e tuple initialized from iterable's items\\n\\nIf the argument is a tuple, the return value is the same object.\", TupleNew, nil)\n```\n\n```go\nvar ZipType = NewTypeX(\"zip\", `zip(iter1 [,iter2 [...]]) --\u003e zip object\n\nReturn a zip object whose .__next__() method returns a tuple where\nthe i-th element comes from the i-th iterable argument.  The .__next__()\nmethod continues until the shortest iterable in the argument sequence\nis exhausted and then it raises StopIteration.`,\n\tZipTypeNew, nil)\n```\n\n## Functions\n\n```go\nfunc AttributeName(keyObj Object) (string, error)\n```\nAttributeName converts an Object to a string, raising a TypeError if it wasn't a String\n\n```go\nfunc DebugRepr(self Object) string\n```\nDebugRepr - see Repr but returns the repr or error as a string\n\n```go\nfunc DeleteAttr(self Object, keyObj Object) error\n```\nDeleteAttr\n\n```go\nfunc DeleteAttrString(self Object, key string) error\n```\nDeleteAttrString\n\n```go\nfunc DivMod(a, b Object) (Object, Object, error)\n```\nDivMod two python objects together returning an Object\n\nWill raise TypeError if can't be divmod can't be run on these objects\n\n```go\nfunc ExceptionClassCheck(err Object) bool\n```\nChecks that the object passed in is a class and is an exception\n\n```go\nfunc ExceptionGivenMatches(err, exc Object) bool\n```\nCheck to see if err matches exc\n\nexc can be a tuple\n\nUsed in except statements\n\n```go\nfunc FloatAsFloat64(obj Object) (float64, error)\n```\nPyFloat\\_AsDouble\n\n```go\nfunc Import(ctx Context, names ...string) error\n```\n\n```go\nfunc IndexInt(a Object) (int, error)\n```\nIndex the python Object returning an int\n\nWill raise TypeError if Index can't be run on this object\n\nor IndexError if the Int won't fit!\n\n```go\nfunc IndexIntCheck(a Object, max int) (int, error)\n```\nAs IndexInt but if index is -ve addresses it from the end\n\nIf index is out of range throws IndexError\n\n```go\nfunc IsException(exception *Type, r interface{}) bool\n```\nIsException matches the result of recover to an exception\n\n### For use to catch a single python exception from go code {#hdr-For_use_to_catch_a_single_python_exception_from_go_code}\n\nIt can be an instance or the class itself\n\n```go\nfunc Iterate(obj Object, fn func(Object) bool) error\n```\nCreate an iterator from obj and iterate the iterator until finished calling the function passed in on each object.  The iteration is finished if the function returns true\n\n```go\nfunc LoadAttr(obj Object, attrName string, dst interface{}) error\n```\nLoadAttr gets the named attribute and attempts to store it into the given destination value (based on its type).\n\n```go\nfunc LoadIntsFromList(list Object) ([]int64, error)\n```\nLoadIntsFromList extracts a list of ints contained given a py.List or py.Tuple\n\n```go\nfunc LoadTuple(args Tuple, vars []interface{}) error\n```\nLoadTuple attempts to convert each element of the given list and store into each destination value (based on its type).\n\n```go\nfunc MakeGoInt(a Object) (int, error)\n```\nTurns a into a go int if possible\n\n```go\nfunc MakeGoInt64(a Object) (int64, error)\n```\nTurns a into a go int64 if possible\n\n```go\nfunc ObjectInit(self Object, args Tuple, kwargs StringDict) error\n```\n\n```go\nfunc ObjectIsSequence(o Object) bool\n```\nReturn whether the object is a sequence\n\n```go\nfunc ObjectIsTrue(o Object) (cmp bool, err error)\n```\nReturn whether the object is True or not\n\n```go\nfunc ParseTuple(args Tuple, format string, results ...*Object) error\n```\nParse tuple only\n\n```go\nfunc ParseTupleAndKeywords(args Tuple, kwargs StringDict, format string, kwlist []string, results ...*Object) error\n```\nParseTupleAndKeywords\n\n```go\nfunc Println(self Object, args ...string) bool\n```\nPrintln prints the provided strings to gpython's stdout.\n\n```go\nfunc RegisterModule(module *ModuleImpl)\n```\n\n```go\nfunc ReprAsString(self Object) (string, error)\n```\nReturns object as a string\n\nCalls Repr then makes sure the output is a string\n\n```go\nfunc SequenceContains(seq, obj Object) (found bool, err error)\n```\nSequenceContains returns True if obj is in seq\n\n```go\nfunc SortInPlace(l *List, kwargs StringDict, funcName string) error\n```\nSortInPlace sorts the given List in place using a stable sort. kwargs can have the keys \"key\" and \"reverse\".\n\n```go\nfunc StrAsString(self Object) (string, error)\n```\nReturns object as a string\n\nCalls Str then makes sure the output is a string\n\n```go\nfunc StringEscape(a String, ascii bool) string\n```\nEscape the py.String\n\n```go\nfunc TracebackDump(err interface{})\n```\nDumps a traceback to stderr\n\n```go\nfunc TypeDelayReady(t *Type)\n```\nTypeDelayReady stores the list of types to initialise\n\nCall MakeReady when all initialised\n\n```go\nfunc TypeInit(cls Object, args Tuple, kwargs StringDict) error\n```\n\n```go\nfunc TypeMakeReady() (err error)\n```\nTypeMakeReady readies all the types\n\n```go\nfunc UnpackTuple(args Tuple, kwargs StringDict, name string, min int, max int, results ...*Object) error\n```\nUnpack the args tuple into the results\n\nUp to the caller to set default values\n\n## Types\n\n```go\ntype BigInt big.Int\n```\n\n```go\nfunc BigIntCheck(obj Object) (*BigInt, error)\n```\nChecks that obj is exactly a BigInt and returns an error if not\n\n```go\nfunc BigIntCheckExact(obj Object) (*BigInt, error)\n```\nChecks that obj is exactly a BigInt and returns an error if not\n\n```go\nfunc ConvertToBigInt(other Object) (*BigInt, bool)\n```\nConvert an Object to an BigInt\n\nReturns ok as to whether the conversion worked or not\n\n```go\nfunc (a *BigInt) Float() (Float, error)\n```\nTruncates to Float\n\nIf it is outside the range of an Float it will return an error\n\n```go\nfunc (a *BigInt) Frexp() (frac float64, exp int)\n```\nFrexp produces frac and exp such that a ~= frac × 2\\*\\*exp\n\n```go\nfunc (x *BigInt) GoInt() (int, error)\n```\nTruncates to go int\n\nIf it is outside the range of an go int it will return an error\n\n```go\nfunc (x *BigInt) GoInt64() (int64, error)\n```\nTruncates to go int64\n\nIf it is outside the range of an go int64 it will return an error\n\n```go\nfunc (x *BigInt) Int() (Int, error)\n```\nTruncates to Int\n\nIf it is outside the range of an Int it will return an error\n\n```go\nfunc (a *BigInt) M__abs__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__add__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__and__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__bool__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__ceil__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__complex__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__divmod__(other Object) (Object, Object, error)\n```\n\n```go\nfunc (a *BigInt) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__float__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__floor__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__floordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__ge__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__gt__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__iadd__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__iand__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__ifloordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__ilshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__imod__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__imul__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__index__() (Int, error)\n```\n\n```go\nfunc (a *BigInt) M__int__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__invert__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__ior__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__ipow__(other, modulus Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__irshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__isub__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__itruediv__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__ixor__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__le__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__lshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__lt__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__mod__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__mul__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__neg__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__or__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__pos__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__pow__(other, modulus Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__radd__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rand__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rdivmod__(other Object) (Object, Object, error)\n```\n\n```go\nfunc (a *BigInt) M__repr__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rfloordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rlshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rmod__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rmul__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__ror__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__round__(digits Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rpow__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rrshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rsub__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rtruediv__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__rxor__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__str__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__sub__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__truediv__(other Object) (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__trunc__() (Object, error)\n```\n\n```go\nfunc (a *BigInt) M__xor__(other Object) (Object, error)\n```\n\n```go\nfunc (x *BigInt) MaybeInt() Object\n```\nMaybeInt truncates to Int if it can, otherwise returns the original BigInt\n\n```go\nfunc (o *BigInt) Type() *Type\n```\nType of this BigInt object\n\n```go\ntype Bool bool\n```\n\n```go\nfunc NewBool(t bool) Bool\n```\nMake a new bool - returns the canonical True and False values\n\n```go\nfunc (a Bool) M__bool__() (Object, error)\n```\n\n```go\nfunc (a Bool) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (a Bool) M__index__() (Int, error)\n```\n\n```go\nfunc (a Bool) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a Bool) M__repr__() (Object, error)\n```\n\n```go\nfunc (a Bool) M__str__() (Object, error)\n```\n\n```go\nfunc (s Bool) Type() *Type\n```\nType of this object\n\n```go\ntype BoundMethod struct {\n\tSelf   Object\n\tMethod Object\n}\n```\nA python BoundMethod object\n\n```go\nfunc NewBoundMethod(self, method Object) *BoundMethod\n```\nDefine a new boundmethod\n\n```go\nfunc (bm *BoundMethod) M__call__(args Tuple, kwargs StringDict) (Object, error)\n```\nCall the bound method\n\n```go\nfunc (o *BoundMethod) Type() *Type\n```\nType of this object\n\n```go\ntype Bytes []byte\n```\n\n```go\nfunc BytesFromObject(x Object) (Bytes, error)\n```\nConverts an object into bytes\n\n```go\nfunc (a Bytes) M__add__(other Object) (Object, error)\n```\n\n```go\nfunc (a Bytes) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (a Bytes) M__ge__(other Object) (Object, error)\n```\n\n```go\nfunc (a Bytes) M__gt__(other Object) (Object, error)\n```\n\n```go\nfunc (a Bytes) M__iadd__(other Object) (Object, error)\n```\n\n```go\nfunc (a Bytes) M__le__(other Object) (Object, error)\n```\n\n```go\nfunc (a Bytes) M__lt__(other Object) (Object, error)\n```\n\n```go\nfunc (a Bytes) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a Bytes) M__repr__() (Object, error)\n```\n\n```go\nfunc (a Bytes) M__str__() (Object, error)\n```\n\n```go\nfunc (a Bytes) Replace(args Tuple) (Object, error)\n```\n\n```go\nfunc (o Bytes) Type() *Type\n```\nType of this Bytes object\n\n```go\ntype CallIterator struct {\n\t// contains filtered or unexported fields\n}\n```\nA python CallIterator object\n\n```go\nfunc NewCallIterator(callable Object, sentinel Object) *CallIterator\n```\nDefine a new CallIterator\n\n```go\nfunc (cit *CallIterator) M__iter__() (Object, error)\n```\n\n```go\nfunc (cit *CallIterator) M__next__() (Object, error)\n```\nGet next one from the iteration\n\n```go\nfunc (o *CallIterator) Type() *Type\n```\nType of this object\n\n```go\ntype Cell struct {\n\t// contains filtered or unexported fields\n}\n```\nA python Cell object\n\n```go\nfunc NewCell(obj Object) *Cell\n```\nDefine a new cell\n\n```go\nfunc (c *Cell) Delete()\n```\nDelete the contents of the Cell\n\n```go\nfunc (c *Cell) Get() Object\n```\nFetch the contents of the Cell or nil if not set\n\n```go\nfunc (c *Cell) Set(obj Object)\n```\nSet the contents of the Cell\n\n```go\nfunc (o *Cell) Type() *Type\n```\nType of this object\n\n```go\ntype ClassMethod struct {\n\tCallable Object\n\tDict     StringDict\n}\n```\n\n```go\nfunc (c *ClassMethod) GetDict() StringDict\n```\nGet the Dict\n\n```go\nfunc (c *ClassMethod) M__get__(instance, owner Object) (Object, error)\n```\nRead a classmethod from a class which makes a bound method\n\n```go\nfunc (o ClassMethod) Type() *Type\n```\nType of this ClassMethod object\n\n```go\ntype Code struct {\n\tArgcount       int32    // #arguments, except *args\n\tKwonlyargcount int32    // #keyword only arguments\n\tNlocals        int32    // #local variables\n\tStacksize      int32    // #entries needed for evaluation stack\n\tFlags          int32    // CO_..., see below\n\tCode           string   // instruction opcodes\n\tConsts         Tuple    // list (constants used)\n\tNames          []string // list of strings (names used)\n\tVarnames       []string // tuple of strings (local variable names)\n\tFreevars       []string // tuple of strings (free variable names)\n\tCellvars       []string // tuple of strings (cell variable names)\n\t// The rest doesn't count for hash or comparisons\n\tCell2arg    []byte // Maps cell vars which are arguments.\n\tFilename    string // unicode (where it was loaded from)\n\tName        string // unicode (name, for reference)\n\tFirstlineno int32  // first source line number\n\tLnotab      string // string (encoding addr\u003c-\u003elineno mapping) See Objects/lnotab_notes.txt for details.\n\n\tWeakreflist *List // to support weakrefs to code objects\n}\n```\nCode object\n\nFreevars are variables declared in the namespace where the code object was defined, they are used when closures are used - these become Cellvars in the function with a closure.\n\nCellvars are names of local variables referenced by functions with a closure.\n\n```go\nfunc NewCode(argcount int32, kwonlyargcount int32,\n\tnlocals int32, stacksize int32, flags int32,\n\tcode_ Object, consts_ Object, names_ Object,\n\tvarnames_ Object, freevars_ Object, cellvars_ Object,\n\tfilename_ Object, name_ Object, firstlineno int32,\n\tlnotab_ Object) *Code\n```\nMake a new code object\n\n```go\nfunc (co *Code) Addr2Line(addrq int32) int32\n```\nUse co\\_lnotab to compute the line number from a bytecode index, addrq.  See lnotab\\_notes.txt for the details of the lnotab representation.\n\n```go\nfunc (co *Code) GetNumFree() int\n```\nReturn number of free variables\n\n```go\nfunc (co *Code) M__eq__(other Object) (Object, error)\n```\nFIXME this should be the default?\n\n```go\nfunc (co *Code) M__ne__(other Object) (Object, error)\n```\nFIXME this should be the default?\n\n```go\nfunc (o *Code) Type() *Type\n```\nType of this object\n\n```go\ntype CompileMode string\n```\n\n```go\nconst (\n\tExecMode   CompileMode = \"exec\"   // Compile a module\n\tEvalMode   CompileMode = \"eval\"   // Compile an expression\n\tSingleMode CompileMode = \"single\" // Compile a single (interactive) statement\n)\n```\n\n```go\ntype CompileOpts struct {\n\tUseSysPaths bool   // If set, sys.path will be used to resolve relative pathnames\n\tCurDir      string // If non-empty, this is the path of the current working directory.  If empty, os.Getwd() is used.\n}\n```\nCompileOpts specifies options for high-level compilation.\n\n```go\ntype CompileOut struct {\n\tSrcPathname string // Resolved pathname the .py file that was compiled (if applicable)\n\tPycPathname string // Pathname of the .pyc file read and/or written (if applicable)\n\tFileDesc    string // Pathname to be used for a a module's \"__file__\" attrib\n\tCode        *Code  // Read/Output code object ready for execution\n}\n```\nCompileOut the output of high-level compilation -- e.g. ResolveAndCompile()\n\n```go\ntype Complex complex128\n```\n\n```go\nfunc (a Complex) M__abs__() (Object, error)\n```\n\n```go\nfunc (a Complex) M__add__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__complex__() (Object, error)\n```\n\n```go\nfunc (a Complex) M__divmod__(other Object) (Object, Object, error)\n```\n\n```go\nfunc (a Complex) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__float__() (Object, error)\n```\n\n```go\nfunc (a Complex) M__floordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__ge__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__gt__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__iadd__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__ifloordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__imod__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__imul__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__int__() (Object, error)\n```\n\n```go\nfunc (a Complex) M__ipow__(other, modulus Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__isub__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__itruediv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__le__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__lt__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__mod__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__mul__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__neg__() (Object, error)\n```\n\n```go\nfunc (a Complex) M__pos__() (Object, error)\n```\n\n```go\nfunc (a Complex) M__pow__(other, modulus Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__radd__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__rdivmod__(other Object) (Object, Object, error)\n```\n\n```go\nfunc (a Complex) M__repr__() (Object, error)\n```\n\n```go\nfunc (a Complex) M__rfloordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__rmod__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__rmul__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__rpow__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__rsub__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__rtruediv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__str__() (Object, error)\n```\n\n```go\nfunc (a Complex) M__sub__(other Object) (Object, error)\n```\n\n```go\nfunc (a Complex) M__truediv__(other Object) (Object, error)\n```\n\n```go\nfunc (o Complex) Type() *Type\n```\nType of this Complex object\n\n```go\ntype Context interface {\n\n\t// Resolves then compiles (if applicable) the given file system pathname into a py.Code ready to be executed.\n\tResolveAndCompile(pathname string, opts CompileOpts) (CompileOut, error)\n\n\t// Creates a new py.Module instance and initializes ModuleImpl's code in the new module (if applicable).\n\tModuleInit(impl *ModuleImpl) (*Module, error)\n\n\t// RunCode is a lower-level invocation to execute the given py.Code.\n\t// Blocks until execution is complete.\n\tRunCode(code *Code, globals, locals StringDict, closure Tuple) (result Object, err error)\n\n\t// Returns the named module for this context (or an error if not found)\n\tGetModule(moduleName string) (*Module, error)\n\n\t// Gereric access to this context's modules / state.\n\tStore() *ModuleStore\n\n\t// Close signals this context is about to go out of scope and any internal resources should be released.\n\t// Code execution on a py.Context that has been closed will result in an error.\n\tClose() error\n\n\t// Done returns a signal that can be used to detect when this Context has fully closed / completed.\n\t// If Close() is called while execution in progress, Done() will not signal until execution is complete.\n\tDone() \u003c-chan struct{}\n}\n```\nContext is a gpython environment instance container, providing a high-level mechanism for multiple python interpreters to run concurrently without restriction.\n\nContext instances maintain completely independent environments, namely the modules that have been imported and their state.  Modules imported into a Context are instanced from a parent ModuleImpl.  For example, since Contexts each have their own sys module instance, each can set sys.path differently and independently.\n\nIf you access a Context from multiple groutines, you are responsible that access is not concurrent, with the exception of Close() and Done().\n\nSee examples/multi-context and examples/embedding.\n\n```go\ntype ContextOpts struct {\n\tSysArgs  []string // sys.argv initializer\n\tSysPaths []string // sys.path initializer\n}\n```\nContextOpts specifies fundamental environment and input settings for creating a new py.Context\n\n```go\ntype EllipsisType struct{}\n```\n\n```go\nfunc (a EllipsisType) M__bool__() (Object, error)\n```\n\n```go\nfunc (a EllipsisType) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (a EllipsisType) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a EllipsisType) M__repr__() (Object, error)\n```\n\n```go\nfunc (s EllipsisType) Type() *Type\n```\nType of this object\n\n```go\ntype Enumerate struct {\n\tIterable Object\n\tStart    Int\n}\n```\nA python Enumerate object\n\n```go\nfunc (e *Enumerate) M__iter__() (Object, error)\n```\nEnumerate iterator\n\n```go\nfunc (e *Enumerate) Type() *Type\n```\nType of this object\n\n```go\ntype EnumerateIterator struct {\n\tEnumerate\n\tIndex Int\n}\n```\nA python Enumerate iterator\n\n```go\nfunc (ei *EnumerateIterator) M__iter__() (Object, error)\n```\nEnumerateIterator iterator\n\n```go\nfunc (ei *EnumerateIterator) M__next__() (Object, error)\n```\nEnumerateIterator iterator next\n\n```go\nfunc (ei *EnumerateIterator) Type() *Type\n```\nType of this object\n\n```go\ntype Exception struct {\n\tBase            *Type\n\tArgs            Object\n\tTraceback       Object\n\tContext         Object\n\tCause           Object\n\tSuppressContext bool\n\tDict            StringDict // anything else that we want to stuff in\n}\n```\nA python Exception object\n\n```go\nfunc ExceptionNewf(metatype *Type, format string, a ...interface{}) *Exception\n```\nExceptionNewf - make a new exception with fmt parameters\n\n```go\nfunc MakeException(r interface{}) *Exception\n```\nCoerce an object into an exception instance one way or another\n\n```go\nfunc MakeSyntaxError(r interface{}, filename string, lineno int, offset int, line string) *Exception\n```\nFirst calls MakeException then adds the extra details in to make it a SyntaxError\n\n```go\nfunc (e *Exception) Error() string\n```\nGo error interface\n\n```go\nfunc (e *Exception) M__getattr__(name string) (Object, error)\n```\nFIXME prototype \\_\\_getattr\\_\\_ before we do introspection!\n\n```go\nfunc (e *Exception) M__repr__() (Object, error)\n```\n\n```go\nfunc (e *Exception) M__str__() (Object, error)\n```\n\n```go\nfunc (e *Exception) Type() *Type\n```\nType of this object\n\n```go\ntype ExceptionInfo struct {\n\tType      *Type\n\tValue     Object\n\tTraceback *Traceback\n}\n```\nA python exception info block\n\n```go\nfunc (e ExceptionInfo) Error() string\n```\nGo error interface\n\n```go\nfunc (exc *ExceptionInfo) IsSet() bool\n```\nTest for being set\n\n```go\nfunc (exc *ExceptionInfo) TracebackDump(w io.Writer)\n```\nDump a traceback for exc to w\n\n```go\ntype File struct {\n\t*os.File\n\tFileMode\n}\n```\n\n```go\nfunc (o *File) Can(mode FileMode) bool\n```\n\n```go\nfunc (o *File) Close() (Object, error)\n```\n\n```go\nfunc (o *File) Flush() (Object, error)\n```\n\n```go\nfunc (o *File) M__enter__() (Object, error)\n```\n\n```go\nfunc (o *File) M__exit__(exc_type, exc_value, traceback Object) (Object, error)\n```\n\n```go\nfunc (o *File) Read(args Tuple, kwargs StringDict) (Object, error)\n```\n\n```go\nfunc (o *File) Type() *Type\n```\nType of this object\n\n```go\nfunc (o *File) Write(value Object) (Object, error)\n```\n\n```go\ntype FileMode int\n```\n\n```go\nconst (\n\tFileRead   FileMode = 0x01\n\tFileWrite  FileMode = 0x02\n\tFileText   FileMode = 0x4000\n\tFileBinary FileMode = 0x8000\n\n\tFileReadWrite = FileRead + FileWrite\n)\n```\n\n```go\nfunc FileModeFrom(mode string) (perm FileMode, trunc, excl bool, err error)\n```\n\n```go\ntype Filter struct {\n\t// contains filtered or unexported fields\n}\n```\nA python Filter object\n\n```go\nfunc (f *Filter) M__iter__() (Object, error)\n```\n\n```go\nfunc (f *Filter) M__next__() (Object, error)\n```\n\n```go\nfunc (f *Filter) Type() *Type\n```\nType of this object\n\n```go\ntype Float float64\n```\n\n```go\nfunc FloatCheck(obj Object) (Float, error)\n```\nReturns the float value of obj if it is a float subclass\n\n```go\nfunc FloatCheckExact(obj Object) (Float, error)\n```\nReturns the float value of obj if it is exactly a float\n\n```go\nfunc (a Float) M__abs__() (Object, error)\n```\n\n```go\nfunc (a Float) M__add__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__bool__() (Object, error)\n```\n\n```go\nfunc (a Float) M__complex__() (Object, error)\n```\n\n```go\nfunc (a Float) M__divmod__(other Object) (Object, Object, error)\n```\n\n```go\nfunc (a Float) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__float__() (Object, error)\n```\n\n```go\nfunc (a Float) M__floordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__ge__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__gt__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__iadd__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__ifloordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__imod__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__imul__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__int__() (Object, error)\n```\n\n```go\nfunc (a Float) M__ipow__(other, modulus Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__isub__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__itruediv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__le__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__lt__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__mod__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__mul__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__neg__() (Object, error)\n```\n\n```go\nfunc (a Float) M__pos__() (Object, error)\n```\n\n```go\nfunc (a Float) M__pow__(other, modulus Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__radd__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__rdivmod__(other Object) (Object, Object, error)\n```\n\n```go\nfunc (a Float) M__repr__() (Object, error)\n```\n\n```go\nfunc (a Float) M__rfloordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__rmod__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__rmul__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__round__(digitsObj Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__rpow__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__rsub__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__rtruediv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__str__() (Object, error)\n```\n\n```go\nfunc (a Float) M__sub__(other Object) (Object, error)\n```\n\n```go\nfunc (a Float) M__truediv__(other Object) (Object, error)\n```\n\n```go\nfunc (o Float) Type() *Type\n```\nType of this Float64 object\n\n```go\ntype Frame struct {\n\t// Back       *Frame        // previous frame, or nil\n\tContext         Context    // host module (state) context\n\tCode            *Code      // code segment\n\tBuiltins        StringDict // builtin symbol table\n\tGlobals         StringDict // global symbol table\n\tLocals          StringDict // local symbol table\n\tStack           []Object   // Valuestack\n\tLocalVars       Tuple      // Fast access local vars\n\tCellAndFreeVars Tuple      // Cellvars then Freevars Cell objects in one Tuple\n\n\t// Next free slot in f_valuestack.  Frame creation sets to f_valuestack.\n\t// Frame evaluation usually NULLs it, but a frame that yields sets it\n\t// to the current stack top.\n\t// Stacktop *Object\n\tYielded bool // set if the function yielded, cleared otherwise\n\n\t// FIXME Tstate *PyThreadState\n\tLasti int32 // Last instruction if called\n\t// Call PyFrame_GetLineNumber() instead of reading this field\n\t// directly.  As of 2.3 f_lineno is only valid when tracing is\n\t// active (i.e. when f_trace is set).  At other times we use\n\t// PyCode_Addr2Line to calculate the line from the current\n\t// bytecode index.\n\t// Lineno     int        // Current line number\n\t// Iblock     int        // index in f_blockstack\n\t// Executing  byte       // whether the frame is still executing\n\tBlockstack []TryBlock // for try and loop blocks\n\tBlock      *TryBlock  // pointer to current block or nil\n\tLocalsplus []Object   // LocalVars + CellAndFreeVars\n}\n```\nA python Frame object\n\n```go\nfunc NewFrame(ctx Context, globals, locals StringDict, code *Code, closure Tuple) *Frame\n```\nMake a new frame for a code object\n\n```go\nfunc (f *Frame) FastToLocals()\n```\nMerge fast locals into frame Locals\n\n```go\nfunc (f *Frame) LocalsToFast(clear bool)\n```\nMerge frame Locals into fast locals\n\n```go\nfunc (f *Frame) Lookup(name string) (obj Object, ok bool)\n```\nPython names are looked up in three scopes\n\nFirst the local scope Next the module global scope And finally the builtins\n\n```go\nfunc (f *Frame) LookupGlobal(name string) (obj Object, ok bool)\n```\nPython globals  are looked up in two scopes\n\nThe module global scope And finally the builtins\n\n```go\nfunc (f *Frame) PopBlock()\n```\nPop the current block off\n\n```go\nfunc (f *Frame) PushBlock(Type TryBlockType, Handler int32, Level int)\n```\nMake a new Block (try/for/while)\n\n```go\nfunc (o *Frame) Type() *Type\n```\nType of this object\n\n```go\ntype FrozenSet struct {\n\tSet\n}\n```\n\n```go\nfunc NewFrozenSet() *FrozenSet\n```\nMake a new empty frozen set\n\n```go\nfunc NewFrozenSetFromItems(items []Object) *FrozenSet\n```\nMake a new set with the items passed in\n\n```go\nfunc (o *FrozenSet) Type() *Type\n```\nType of this FrozenSet object\n\n```go\ntype Function struct {\n\tCode        *Code      // A code object, the __code__ attribute\n\tContext     Context    // Host VM context\n\tGlobals     StringDict // A dictionary (other mappings won't do)\n\tDefaults    Tuple      // NULL or a tuple\n\tKwDefaults  StringDict // NULL or a dict\n\tClosure     Tuple      // NULL or a tuple of cell objects\n\tDoc         Object     // The __doc__ attribute, can be anything\n\tName        string     // The __name__ attribute, a string object\n\tDict        StringDict // The __dict__ attribute, a dict or NULL\n\tWeakreflist List       // List of weak references\n\tAnnotations StringDict // Annotations, a dict or NULL\n\tQualname    string     // The qualified name\n}\n```\nA python Function object\n\n```go\nfunc NewFunction(ctx Context, code *Code, globals StringDict, qualname string) *Function\n```\nDefine a new function\n\nReturn a new function object associated with the code object code. globals must be a dictionary with the global variables accessible to the function.\n\nThe function’s docstring, name and \\_\\_module\\_\\_ are retrieved from the code object, the argument defaults and closure are set to NULL.\n\nAllows to set the function object’s \\_\\_qualname\\_\\_ attribute. qualname should be a unicode object or \"\"; if \"\", the \\_\\_qualname\\_\\_ attribute is set to the same value as its \\_\\_name\\_\\_ attribute.\n\n```go\nfunc (f *Function) GetDict() StringDict\n```\nGet the Dict\n\n```go\nfunc (f *Function) M__call__(args Tuple, kwargs StringDict) (Object, error)\n```\nCall a function\n\n```go\nfunc (f *Function) M__get__(instance, owner Object) (Object, error)\n```\nRead a function from a class which makes a bound method\n\n```go\nfunc (o *Function) Type() *Type\n```\nType of this object\n\n```go\ntype Generator struct {\n\t// Note: gi_frame can be NULL if the generator is \"finished\"\n\tFrame *Frame\n\n\t// True if generator is being executed.\n\tRunning bool\n\n\t// The code object backing the generator\n\tCode *Code\n\n\t// List of weak reference.\n\tWeakreflist Object\n}\n```\nA python Generator object\n\n```go\nfunc NewGenerator(frame *Frame) *Generator\n```\nDefine a new generator\n\n```go\nfunc (it *Generator) Close() (Object, error)\n```\ngenerator.close()\n\nRaises a GeneratorExit at the point where the generator function was paused. If the generator function then raises StopIteration (by exiting normally, or due to already being closed) or GeneratorExit (by not catching the exception), close returns to its caller. If the generator yields a value, a RuntimeError is raised. If the generator raises any other exception, it is propagated to the caller. close() does nothing if the generator has already exited due to an exception or normal exit.\n\n```go\nfunc (it *Generator) M__iter__() (Object, error)\n```\n\n```go\nfunc (it *Generator) M__next__() (Object, error)\n```\ngenerator.\\_\\_next\\_\\_()\n\nStarts the execution of a generator function or resumes it at the last executed yield expression. When a generator function is resumed with a \\_\\_next\\_\\_() method, the current yield expression always evaluates to None. The execution then continues to the next yield expression, where the generator is suspended again, and the value of the expression\\_list is returned to next()‘s caller. If the generator exits without yielding another value, a StopIteration exception is raised.\n\nThis method is normally called implicitly, e.g. by a for loop, or by the built-in next() function.\n\n```go\nfunc (it *Generator) Send(arg Object) (Object, error)\n```\ngenerator.send(value)\n\nResumes the execution and “sends” a value into the generator function. The value argument becomes the result of the current yield expression. The send() method returns the next value yielded by the generator, or raises StopIteration if the generator exits without yielding another value. When send() is called to start the generator, it must be called with None as the argument, because there is no yield expression that could receive the value.\n\n```go\nfunc (it *Generator) Throw(args Tuple, kwargs StringDict) (Object, error)\n```\ngenerator.throw(type\\[, value\\[, traceback]])\n\nRaises an exception of type type at the point where generator was paused, and returns the next value yielded by the generator function. If the generator exits without yielding another value, a StopIteration exception is raised. If the generator function does not catch the passed-in exception, or raises a different exception, then that exception propagates to the caller.\n\n```go\nfunc (o *Generator) Type() *Type\n```\nType of this object\n\n```go\ntype IGetDict interface {\n\tGetDict() StringDict\n}\n```\nOptional interfaces\n\n```go\ntype IGoInt interface {\n\tGoInt() (int, error)\n}\n```\n\n```go\ntype IGoInt64 interface {\n\tGoInt64() (int64, error)\n}\n```\n\n```go\ntype I__abs__ interface {\n\tM__abs__() (Object, error)\n}\n```\nobject.\\_\\_abs\\_\\_(self)\n\n```go\ntype I__add__ interface {\n\tM__add__(other Object) (Object, error)\n}\n```\nobject.\\_\\_add\\_\\_(self, other)\n\n```go\ntype I__and__ interface {\n\tM__and__(other Object) (Object, error)\n}\n```\nobject.\\_\\_and\\_\\_(self, other)\n\n```go\ntype I__bool__ interface {\n\tM__bool__() (Object, error)\n}\n```\nCalled to implement truth value testing and the built-in operation bool(); should return False or True. When this method is not defined, \\_\\_len\\_\\_() is called, if it is defined, and the object is considered true if its result is nonzero. If a class defines neither \\_\\_len\\_\\_() nor \\_\\_bool\\_\\_(), all its instances are considered true. object.\\_\\_bool\\_\\_(self)\n\n```go\ntype I__bytes__ interface {\n\tM__bytes__() (Object, error)\n}\n```\nCalled by bytes() to compute a byte-string representation of an object. This should return a bytes object. object.\\_\\_bytes\\_\\_(self)\n\n```go\ntype I__call__ interface {\n\tM__call__(args Tuple, kwargs StringDict) (Object, error)\n}\n```\nCalled when the instance is “called” as a function; if this method is defined, x(arg1, arg2, ...) is a shorthand for x.\\_\\_call\\_\\_(arg1, arg2, ...). object.\\_\\_call\\_\\_(self\\[, args...])\n\n```go\ntype I__ceil__ interface {\n\tM__ceil__() (Object, error)\n}\n```\nReturn the ceiling of x, the smallest integer greater than or equal to x. If x is not a float, delegates to x.\\_\\_ceil\\_\\_(), which should return an Integral value. object.\\_\\_float\\_\\_(self)\n\n```go\ntype I__complex__ interface {\n\tM__complex__() (Object, error)\n}\n```\nobject.\\_\\_complex\\_\\_(self)\n\n```go\ntype I__contains__ interface {\n\tM__contains__(item Object) (Object, error)\n}\n```\nCalled to implement membership test operators. Should return true if item is in self, false otherwise. For mapping objects, this should consider the keys of the mapping rather than the values or the key-item pairs.\n\nFor objects that don’t define \\_\\_contains\\_\\_(), the membership test first tries iteration via \\_\\_iter\\_\\_(), then the old sequence iteration protocol via \\_\\_getitem\\_\\_(), see this section in the language reference. object.\\_\\_contains\\_\\_(self, item)\n\n```go\ntype I__del__ interface {\n\tM__del__() (Object, error)\n}\n```\nCalled when the instance is about to be destroyed. This is also called a destructor. If a base class has a \\_\\_del\\_\\_() method, the derived class’s \\_\\_del\\_\\_() method, if any, must explicitly call it to ensure proper deletion of the base class part of the instance. Note that it is possible (though not recommended!) for the \\_\\_del\\_\\_() method to postpone destruction of the instance by creating a new reference to it. It may then be called at a later time when this new reference is deleted. It is not guaranteed that \\_\\_del\\_\\_() methods are called for objects that still exist when the interpreter exits.\n\nNote del x doesn’t directly call x.\\_\\_del\\_\\_() — the former decrements the reference count for x by one, and the latter is only called when x‘s reference count reaches zero. Some common situations that may prevent the reference count of an object from going to zero include: circular references between objects (e.g., a doubly-linked list or a tree data structure with parent and child pointers); a reference to the object on the stack frame of a function that caught an exception (the traceback stored in sys.exc\\_info()\\[2] keeps the stack frame alive); or a reference to the object on the stack frame that raised an unhandled exception in interactive mode (the traceback stored in sys.last\\_traceback keeps the stack frame alive). The first situation can only be remedied by explicitly breaking the cycles; the latter two situations can be resolved by storing None in sys.last\\_traceback. Circular references which are garbage are detected and cleaned up when the cyclic garbage collector is enabled (it’s on by default). Refer to the documentation for the gc module for more information about this topic.\n\nWarning Due to the precarious circumstances under which \\_\\_del\\_\\_() methods are invoked, exceptions that occur during their execution are ignored, and a warning is printed to sys.stderr instead. Also, when \\_\\_del\\_\\_() is invoked in response to a module being deleted (e.g., when execution of the program is done), other globals referenced by the \\_\\_del\\_\\_() method may already have been deleted or in the process of being torn down (e.g. the import machinery shutting down). For this reason, \\_\\_del\\_\\_() methods should do the absolute minimum needed to maintain external invariants. Starting with version 1.5, Python guarantees that globals whose name begins with a single underscore are deleted from their module before other globals are deleted; if no other references to such globals exist, this may help in assuring that imported modules are still available at the time when the \\_\\_del\\_\\_() method is called. object.\\_\\_del\\_\\_(self)\n\n```go\ntype I__delattr__ interface {\n\tM__delattr__(name string) (Object, error)\n}\n```\nLike \\_\\_setattr\\_\\_() but for attribute deletion instead of assignment. This should only be implemented if del obj.name is meaningful for the object. object.\\_\\_delattr\\_\\_(self, name)\n\n```go\ntype I__delete__ interface {\n\tM__delete__(instance Object) (Object, error)\n}\n```\nCalled to delete the attribute on an instance instance of the owner class. object.\\_\\_delete\\_\\_(self, instance)\n\n```go\ntype I__delitem__ interface {\n\tM__delitem__(key Object) (Object, error)\n}\n```\nCalled to implement deletion of self\\[key]. Same note as for \\_\\_getitem\\_\\_(). This should only be implemented for mappings if the objects support removal of keys, or for sequences if elements can be removed from the sequence. The same exceptions should be raised for improper key values as for the \\_\\_getitem\\_\\_() method. object.\\_\\_delitem\\_\\_(self, key)\n\n```go\ntype I__dir__ interface {\n\tM__dir__() (Object, error)\n}\n```\nCalled when dir() is called on the object. A sequence must be returned. dir() converts the returned sequence to a list and sorts it. object.\\_\\_dir\\_\\_(self)\n\n```go\ntype I__divmod__ interface {\n\tM__divmod__(other Object) (Object, Object, error)\n}\n```\nobject.\\_\\_divmod\\_\\_(self, other)\n\n```go\ntype I__enter__ interface {\n\tM__enter__() (Object, error)\n}\n```\nEnter the runtime context related to this object. The with statement will bind this method’s return value to the target(s) specified in the as clause of the statement, if any. object.\\_\\_enter\\_\\_(self)\n\n```go\ntype I__eq__ interface {\n\tM__eq__(other Object) (Object, error)\n}\n```\nobject.\\_\\_eq\\_\\_(self, other)\n\n```go\ntype I__exit__ interface {\n\tM__exit__(exc_type, exc_value, traceback Object) (Object, error)\n}\n```\nExit the runtime context related to this object. The parameters describe the exception that caused the context to be exited. If the context was exited without an exception, all three arguments will be None.\n\nIf an exception is supplied, and the method wishes to suppress the exception (i.e., prevent it from being propagated), it should return a true value. Otherwise, the exception will be processed normally upon exit from this method.\n\nNote that \\_\\_exit\\_\\_() methods should not reraise the passed-in exception; this is the caller’s responsibility. object.\\_\\_exit\\_\\_(self, exc\\_type, exc\\_value, traceback)\n\n```go\ntype I__float__ interface {\n\tM__float__() (Object, error)\n}\n```\nobject.\\_\\_float\\_\\_(self)\n\n```go\ntype I__floor__ interface {\n\tM__floor__() (Object, error)\n}\n```\nReturn the floor of x, the largest integer less than or equal to x. If x is not a float, delegates to x.\\_\\_floor\\_\\_(), which should return an Integral value.\n\n```go\ntype I__floordiv__ interface {\n\tM__floordiv__(other Object) (Object, error)\n}\n```\nobject.\\_\\_floordiv\\_\\_(self, other)\n\n```go\ntype I__format__ interface {\n\tM__format__(format_spec Object) (Object, error)\n}\n```\nCalled by the format() built-in function (and by extension, the str.format() method of class str) to produce a “formatted” string representation of an object. The format\\_spec argument is a string that contains a description of the formatting options desired. The interpretation of the format\\_spec argument is up to the type implementing \\_\\_format\\_\\_(), however most classes will either delegate formatting to one of the built-in types, or use a similar formatting option syntax.\n\nSee Format Specification Mini-Language for a description of the standard formatting syntax.\n\nThe return value must be a string object. object.\\_\\_format\\_\\_(self, format\\_spec)\n\n```go\ntype I__ge__ interface {\n\tM__ge__(other Object) (Object, error)\n}\n```\nobject.\\_\\_ge\\_\\_(self, other)\n\n```go\ntype I__get__ interface {\n\tM__get__(instance, owner Object) (Object, error)\n}\n```\nCalled to get the attribute of the owner class (class attribute access) or of an instance of that class (instance attribute access). owner is always the owner class, while instance is the instance that the attribute was accessed through, or None when the attribute is accessed through the owner. This method should return the (computed) attribute value or raise an AttributeError exception. object.\\_\\_get\\_\\_(self, instance, owner)\n\n```go\ntype I__getattr__ interface {\n\tM__getattr__(name string) (Object, error)\n}\n```\nCalled when an attribute lookup has not found the attribute in the usual places (i.e. it is not an instance attribute nor is it found in the class tree for self). name is the attribute name. This method should return the (computed) attribute value or raise an AttributeError exception.\n\nNote that if the attribute is found through the normal mechanism, \\_\\_getattr\\_\\_() is not called. (This is an intentional asymmetry between \\_\\_getattr\\_\\_() and \\_\\_setattr\\_\\_().) This is done both for efficiency reasons and because otherwise \\_\\_getattr\\_\\_() would have no way to access other attributes of the instance. Note that at least for instance variables, you can fake total control by not inserting any values in the instance attribute dictionary (but instead inserting them in another object). See the \\_\\_getattribute\\_\\_() method below for a way to actually get total control over attribute access. object.\\_\\_getattr\\_\\_(self, name)\n\n```go\ntype I__getattribute__ interface {\n\tM__getattribute__(name string) (Object, error)\n}\n```\nCalled unconditionally to implement attribute accesses for instances of the class. If the class also defines \\_\\_getattr\\_\\_(), the latter will not be called unless \\_\\_getattribute\\_\\_() either calls it explicitly or raises an AttributeError. This method should return the (computed) attribute value or raise an AttributeError exception. In order to avoid infinite recursion in this method, its implementation should always call the base class method with the same name to access any attributes it needs, for example, object.\\_\\_getattribute\\_\\_(self, name).\n\nNote This method may still be bypassed when looking up special methods as the result of implicit invocation via language syntax or built-in functions. See Special method lookup. object.\\_\\_getattribute\\_\\_(self, name)\n\n```go\ntype I__getitem__ interface {\n\tM__getitem__(key Object) (Object, error)\n}\n```\nCalled to implement evaluation of self\\[key]. For sequence types, the accepted keys should be integers and slice objects. Note that the special interpretation of negative indexes (if the class wishes to emulate a sequence type) is up to the \\_\\_getitem\\_\\_() method. If key is of an inappropriate type, TypeError may be raised; if of a value outside the set of indexes for the sequence (after any special interpretation of negative values), IndexError should be raised. For mapping types, if key is missing (not in the container), KeyError should be raised.\n\nNote for loops expect that an IndexError will be raised for illegal indexes to allow proper detection of the end of the sequence. object.\\_\\_getitem\\_\\_(self, key)\n\n```go\ntype I__gt__ interface {\n\tM__gt__(other Object) (Object, error)\n}\n```\nobject.\\_\\_gt\\_\\_(self, other)\n\n```go\ntype I__hash__ interface {\n\tM__hash__() (Object, error)\n}\n```\nCalled by built-in function hash() and for operations on members of hashed collections including set, frozenset, and dict. \\_\\_hash\\_\\_() should return an integer. The only required property is that objects which compare equal have the same hash value; it is advised to somehow mix together (e.g. using exclusive or) the hash values for the components of the object that also play a part in comparison of objects.\n\nNote hash() truncates the value returned from an object’s custom \\_\\_hash\\_\\_() method to the size of a Py\\_ssize\\_t. This is typically 8 bytes on 64-bit builds and 4 bytes on 32-bit builds. If an object’s \\_\\_hash\\_\\_() must interoperate on builds of different bit sizes, be sure to check the width on all supported builds. An easy way to do this is with python -c \"import sys; print(sys.hash\\_info.width)\"\n\nIf a class does not define an \\_\\_eq\\_\\_() method it should not define a \\_\\_hash\\_\\_() operation either; if it defines \\_\\_eq\\_\\_() but not \\_\\_hash\\_\\_(), its instances will not be usable as items in hashable collections. If a class defines mutable objects and implements an \\_\\_eq\\_\\_() method, it should not implement \\_\\_hash\\_\\_(), since the implementation of hashable collections requires that a key’s hash value is immutable (if the object’s hash value changes, it will be in the wrong hash bucket).\n\nUser-defined classes have \\_\\_eq\\_\\_() and \\_\\_hash\\_\\_() methods by default; with them, all objects compare unequal (except with themselves) and x.\\_\\_hash\\_\\_() returns an appropriate value such that x == y implies both that x is y and hash(x) == hash(y).\n\nA class that overrides \\_\\_eq\\_\\_() and does not define \\_\\_hash\\_\\_() will have its \\_\\_hash\\_\\_() implicitly set to None. When the \\_\\_hash\\_\\_() method of a class is None, instances of the class will raise an appropriate TypeError when a program attempts to retrieve their hash value, and will also be correctly identified as unhashable when checking isinstance(obj, collections.Hashable).\n\nIf a class that overrides \\_\\_eq\\_\\_() needs to retain the implementation of \\_\\_hash\\_\\_() from a parent class, the interpreter must be told this explicitly by setting \\_\\_hash\\_\\_ = \\\u003cParentClass\u003e.\\_\\_hash\\_\\_.\n\nIf a class that does not override \\_\\_eq\\_\\_() wishes to suppress hash support, it should include \\_\\_hash\\_\\_ = None in the class definition. A class which defines its own \\_\\_hash\\_\\_() that explicitly raises a TypeError would be incorrectly identified as hashable by an isinstance(obj, collections.Hashable) call.\n\nNote By default, the \\_\\_hash\\_\\_() values of str, bytes and datetime objects are “salted” with an unpredictable random value. Although they remain constant within an individual Python process, they are not predictable between repeated invocations of Python.\n\nThis is intended to provide protection against a denial-of-service caused by carefully-chosen inputs that exploit the worst case performance of a dict insertion, O(n^2) complexity. See [http://www.ocert.org/advisories/ocert-2011-003.html](http://www.ocert.org/advisories/ocert-2011-003.html) for details.\n\nChanging hash values affects the iteration order of dicts, sets and other mappings. Python has never made guarantees about this ordering (and it typically varies between 32-bit and 64-bit builds).\n\nSee also PYTHONHASHSEED.\n\nChanged in version 3.3: Hash randomization is enabled by default. object.\\_\\_hash\\_\\_(self)\n\n```go\ntype I__iadd__ interface {\n\tM__iadd__(other Object) (Object, error)\n}\n```\nobject.\\_\\_iadd\\_\\_(self, other)\n\n```go\ntype I__iand__ interface {\n\tM__iand__(other Object) (Object, error)\n}\n```\nobject.\\_\\_iand\\_\\_(self, other)\n\n```go\ntype I__ifloordiv__ interface {\n\tM__ifloordiv__(other Object) (Object, error)\n}\n```\nobject.\\_\\_ifloordiv\\_\\_(self, other)\n\n```go\ntype I__ilshift__ interface {\n\tM__ilshift__(other Object) (Object, error)\n}\n```\nobject.\\_\\_ilshift\\_\\_(self, other)\n\n```go\ntype I__imod__ interface {\n\tM__imod__(other Object) (Object, error)\n}\n```\nobject.\\_\\_imod\\_\\_(self, other)\n\n```go\ntype I__imul__ interface {\n\tM__imul__(other Object) (Object, error)\n}\n```\nobject.\\_\\_imul\\_\\_(self, other)\n\n```go\ntype I__index__ interface {\n\tM__index__() (Int, error)\n}\n```\nobject.\\_\\_index\\_\\_(self)\n\n```go\ntype I__init__ interface {\n\tM__init__(self, args, kwargs Object) (Object, error)\n}\n```\nCalled when the instance is created. The arguments are those passed to the class constructor expression. If a base class has an \\_\\_init\\_\\_() method, the derived class’s \\_\\_init\\_\\_() method, if any, must explicitly call it to ensure proper initialization of the base class part of the instance; for example: BaseClass.\\_\\_init\\_\\_(self, \\[args...]). As a special constraint on constructors, no value may be returned; doing so will cause a TypeError to be raised at runtime. object.\\_\\_init\\_\\_(self\\[, ...])\n\n```go\ntype I__instancecheck__ interface {\n\tM__instancecheck__(instance Object) (Object, error)\n}\n```\nReturn true if instance should be considered a (direct or indirect) instance of class. If defined, called to implement isinstance(instance, class). object.\\_\\_instancecheck\\_\\_(self, instance)\n\n```go\ntype I__int__ interface {\n\tM__int__() (Object, error)\n}\n```\nobject.\\_\\_int\\_\\_(self)\n\n```go\ntype I__invert__ interface {\n\tM__invert__() (Object, error)\n}\n```\nobject.\\_\\_invert\\_\\_(self)\n\n```go\ntype I__ior__ interface {\n\tM__ior__(other Object) (Object, error)\n}\n```\nobject.\\_\\_ior\\_\\_(self, other)\n\n```go\ntype I__ipow__ interface {\n\tM__ipow__(other, modulo Object) (Object, error)\n}\n```\n\n```go\ntype I__irshift__ interface {\n\tM__irshift__(other Object) (Object, error)\n}\n```\nobject.\\_\\_irshift\\_\\_(self, other)\n\n```go\ntype I__isub__ interface {\n\tM__isub__(other Object) (Object, error)\n}\n```\nobject.\\_\\_isub\\_\\_(self, other)\n\n```go\ntype I__iter__ interface {\n\tM__iter__() (Object, error)\n}\n```\nThis method is called when an iterator is required for a container. This method should return a new iterator object that can iterate over all the objects in the container. For mappings, it should iterate over the keys of the container, and should also be made available as the method keys().\n\nIterator objects also need to implement this method; they are required to return themselves. For more information on iterator objects, see Iterator Types. object.\\_\\_iter\\_\\_(self)\n\n```go\ntype I__itruediv__ interface {\n\tM__itruediv__(other Object) (Object, error)\n}\n```\nobject.\\_\\_itruediv\\_\\_(self, other)\n\n```go\ntype I__ixor__ interface {\n\tM__ixor__(other Object) (Object, error)\n}\n```\nobject.\\_\\_ixor\\_\\_(self, other)\n\n```go\ntype I__le__ interface {\n\tM__le__(other Object) (Object, error)\n}\n```\nobject.\\_\\_le\\_\\_(self, other)\n\n```go\ntype I__len__ interface {\n\tM__len__() (Object, error)\n}\n```\nCalled to implement the built-in function len(). Should return the length of the object, an integer \u003e= 0. Also, an object that doesn’t define a \\_\\_bool\\_\\_() method and whose \\_\\_len\\_\\_() method returns zero is considered to be false in a Boolean context. object.\\_\\_len\\_\\_(self)\n\n```go\ntype I__length_hint__ interface {\n\tM__length_hint__() (Object, error)\n}\n```\nCalled to implement operator.length\\_hint(). Should return an estimated length for the object (which may be greater or less than the actual length). The length must be an integer \u003e= 0. This method is purely an optimization and is never required for correctness.\n\nNew in version 3.4. object.\\_\\_length\\_hint\\_\\_(self)\n\n```go\ntype I__lshift__ interface {\n\tM__lshift__(other Object) (Object, error)\n}\n```\nobject.\\_\\_lshift\\_\\_(self, other)\n\n```go\ntype I__lt__ interface {\n\tM__lt__(other Object) (Object, error)\n}\n```\nThese are the so-called “rich comparison” methods. The correspondence between operator symbols and method names is as follows: x\\\u003cy calls x.\\_\\_lt\\_\\_(y), x\\\u003c=y calls x.\\_\\_le\\_\\_(y), x==y calls x.\\_\\_eq\\_\\_(y), x!=y calls x.\\_\\_ne\\_\\_(y), x\u003ey calls x.\\_\\_gt\\_\\_(y), and x\u003e=y calls x.\\_\\_ge\\_\\_(y).\n\nA rich comparison method may return the singleton NotImplemented if it does not implement the operation for a given pair of arguments. By convention, False and True are returned for a successful comparison. However, these methods can return any value, so if the comparison operator is used in a Boolean context (e.g., in the condition of an if statement), Python will call bool() on the value to determine if the result is true or false.\n\nThere are no implied relationships among the comparison operators. The truth of x==y does not imply that x!=y is false. Accordingly, when defining \\_\\_eq\\_\\_(), one should also define \\_\\_ne\\_\\_() so that the operators will behave as expected. See the paragraph on \\_\\_hash\\_\\_() for some important notes on creating hashable objects which support custom comparison operations and are usable as dictionary keys.\n\nThere are no swapped-argument versions of these methods (to be used when the left argument does not support the operation but the right argument does); rather, \\_\\_lt\\_\\_() and \\_\\_gt\\_\\_() are each other’s reflection, \\_\\_le\\_\\_() and \\_\\_ge\\_\\_() are each other’s reflection, and \\_\\_eq\\_\\_() and \\_\\_ne\\_\\_() are their own reflection.\n\nArguments to rich comparison methods are never coerced.\n\nTo automatically generate ordering operations from a single root operation, see functools.total\\_ordering(). object.\\_\\_lt\\_\\_(self, other)\n\n```go\ntype I__mod__ interface {\n\tM__mod__(other Object) (Object, error)\n}\n```\nobject.\\_\\_mod\\_\\_(self, other)\n\n```go\ntype I__mul__ interface {\n\tM__mul__(other Object) (Object, error)\n}\n```\nobject.\\_\\_mul\\_\\_(self, other)\n\n```go\ntype I__ne__ interface {\n\tM__ne__(other Object) (Object, error)\n}\n```\nobject.\\_\\_ne\\_\\_(self, other)\n\n```go\ntype I__neg__ interface {\n\tM__neg__() (Object, error)\n}\n```\nobject.\\_\\_neg\\_\\_(self)\n\n```go\ntype I__new__ interface {\n\tM__new__(cls, args, kwargs Object) (Object, error)\n}\n```\nCalled to create a new instance of class cls. \\_\\_new\\_\\_() is a static method (special-cased so you need not declare it as such) that takes the class of which an instance was requested as its first argument. The remaining arguments are those passed to the object constructor expression (the call to the class). The return value of \\_\\_new\\_\\_() should be the new object instance (usually an instance of cls).\n\nTypical implementations create a new instance of the class by invoking the superclass’s \\_\\_new\\_\\_() method using super(currentclass, cls).\\_\\_new\\_\\_(cls\\[, ...]) with appropriate arguments and then modifying the newly-created instance as necessary before returning it.\n\nIf \\_\\_new\\_\\_() returns an instance of cls, then the new instance’s \\_\\_init\\_\\_() method will be invoked like \\_\\_init\\_\\_(self\\[, ...]), where self is the new instance and the remaining arguments are the same as were passed to \\_\\_new\\_\\_().\n\nIf \\_\\_new\\_\\_() does not return an instance of cls, then the new instance’s \\_\\_init\\_\\_() method will not be invoked.\n\n\\_\\_new\\_\\_() is intended mainly to allow subclasses of immutable types (like int, str, or tuple) to customize instance creation. It is also commonly overridden in custom metaclasses in order to customize class creation. object.\\_\\_new\\_\\_(cls\\[, ...])\n\n```go\ntype I__next__ interface {\n\tM__next__() (Object, error)\n}\n```\nThe next method for iterators\n\n```go\ntype I__or__ interface {\n\tM__or__(other Object) (Object, error)\n}\n```\nobject.\\_\\_or\\_\\_(self, other)\n\n```go\ntype I__pos__ interface {\n\tM__pos__() (Object, error)\n}\n```\nobject.\\_\\_pos\\_\\_(self)\n\n```go\ntype I__pow__ interface {\n\tM__pow__(other, modulo Object) (Object, error)\n}\n```\nobject.\\_\\_pow\\_\\_(self, other\\[, modulo])\n\n```go\ntype I__radd__ interface {\n\tM__radd__(other Object) (Object, error)\n}\n```\nobject.\\_\\_radd\\_\\_(self, other)\n\n```go\ntype I__rand__ interface {\n\tM__rand__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rand\\_\\_(self, other)\n\n```go\ntype I__rdivmod__ interface {\n\tM__rdivmod__(other Object) (Object, Object, error)\n}\n```\nobject.\\_\\_rdivmod\\_\\_(self, other)\n\n```go\ntype I__repr__ interface {\n\tM__repr__() (Object, error)\n}\n```\nCalled by the repr() built-in function to compute the “official” string representation of an object. If at all possible, this should look like a valid Python expression that could be used to recreate an object with the same value (given an appropriate environment). If this is not possible, a string of the form \\\u003c...some useful description...\u003e should be returned. The return value must be a string object. If a class defines \\_\\_repr\\_\\_() but not \\_\\_str\\_\\_(), then \\_\\_repr\\_\\_() is also used when an “informal” string representation of instances of that class is required.\n\nThis is typically used for debugging, so it is important that the representation is information-rich and unambiguous. object.\\_\\_repr\\_\\_(self)\n\n```go\ntype I__reversed__ interface {\n\tM__reversed__() (Object, error)\n}\n```\nCalled (if present) by the reversed() built-in to implement reverse iteration. It should return a new iterator object that iterates over all the objects in the container in reverse order.\n\nIf the \\_\\_reversed\\_\\_() method is not provided, the reversed() built-in will fall back to using the sequence protocol (\\_\\_len\\_\\_() and \\_\\_getitem\\_\\_()). Objects that support the sequence protocol should only provide \\_\\_reversed\\_\\_() if they can provide an implementation that is more efficient than the one provided by reversed(). object.\\_\\_reversed\\_\\_(self)\n\n```go\ntype I__rfloordiv__ interface {\n\tM__rfloordiv__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rfloordiv\\_\\_(self, other)\n\n```go\ntype I__rlshift__ interface {\n\tM__rlshift__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rlshift\\_\\_(self, other)\n\n```go\ntype I__rmod__ interface {\n\tM__rmod__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rmod\\_\\_(self, other)\n\n```go\ntype I__rmul__ interface {\n\tM__rmul__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rmul\\_\\_(self, other)\n\n```go\ntype I__ror__ interface {\n\tM__ror__(other Object) (Object, error)\n}\n```\nobject.\\_\\_ror\\_\\_(self, other)\n\n```go\ntype I__round__ interface {\n\tM__round__(n Object) (Object, error)\n}\n```\nobject.\\_\\_round\\_\\_(self, n)\n\n```go\ntype I__rpow__ interface {\n\tM__rpow__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rpow\\_\\_(self, other)\n\n```go\ntype I__rrshift__ interface {\n\tM__rrshift__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rrshift\\_\\_(self, other)\n\n```go\ntype I__rshift__ interface {\n\tM__rshift__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rshift\\_\\_(self, other)\n\n```go\ntype I__rsub__ interface {\n\tM__rsub__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rsub\\_\\_(self, other)\n\n```go\ntype I__rtruediv__ interface {\n\tM__rtruediv__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rtruediv\\_\\_(self, other)\n\n```go\ntype I__rxor__ interface {\n\tM__rxor__(other Object) (Object, error)\n}\n```\nobject.\\_\\_rxor\\_\\_(self, other)\n\n```go\ntype I__set__ interface {\n\tM__set__(instance, value Object) (Object, error)\n}\n```\nCalled to set the attribute on an instance of the owner class to a new value. object.\\_\\_set\\_\\_(self, instance, value)\n\n```go\ntype I__setattr__ interface {\n\tM__setattr__(name string, value Object) (Object, error)\n}\n```\nCalled when an attribute assignment is attempted. This is called instead of the normal mechanism (i.e. store the value in the instance dictionary). name is the attribute name, value is the value to be assigned to it.\n\nIf \\_\\_setattr\\_\\_() wants to assign to an instance attribute, it should call the base class method with the same name, for example, object.\\_\\_setattr\\_\\_(self, name, value). object.\\_\\_setattr\\_\\_(self, name, value)\n\n```go\ntype I__setitem__ interface {\n\tM__setitem__(key, value Object) (Object, error)\n}\n```\nCalled to implement assignment to self\\[key]. Same note as for \\_\\_getitem\\_\\_(). This should only be implemented for mappings if the objects support changes to the values for keys, or if new keys can be added, or for sequences if elements can be replaced. The same exceptions should be raised for improper key values as for the \\_\\_getitem\\_\\_() method. object.\\_\\_setitem\\_\\_(self, key, value)\n\n```go\ntype I__str__ interface {\n\tM__str__() (Object, error)\n}\n```\nCalled by str(object) and the built-in functions format() and print() to compute the “informal” or nicely printable string representation of an object. The return value must be a string object.\n\nThis method differs from object.\\_\\_repr\\_\\_() in that there is no expectation that \\_\\_str\\_\\_() return a valid Python expression: a more convenient or concise representation can be used.\n\nThe default implementation defined by the built-in type object calls object.\\_\\_repr\\_\\_(). object.\\_\\_str\\_\\_(self)\n\n```go\ntype I__sub__ interface {\n\tM__sub__(other Object) (Object, error)\n}\n```\nobject.\\_\\_sub\\_\\_(self, other)\n\n```go\ntype I__subclasscheck__ interface {\n\tM__subclasscheck__(subclass Object) (Object, error)\n}\n```\nReturn true if subclass should be considered a (direct or indirect) subclass of class. If defined, called to implement issubclass(subclass, class). object.\\_\\_subclasscheck\\_\\_(self, subclass)\n\n```go\ntype I__truediv__ interface {\n\tM__truediv__(other Object) (Object, error)\n}\n```\nobject.\\_\\_truediv\\_\\_(self, other)\n\n```go\ntype I__trunc__ interface {\n\tM__trunc__() (Object, error)\n}\n```\nReturn the Real value x truncated to an Integral (usually an integer). Delegates to x.\\_\\_trunc\\_\\_().\n\n```go\ntype I__xor__ interface {\n\tM__xor__(other Object) (Object, error)\n}\n```\nobject.\\_\\_xor\\_\\_(self, other)\n\n```go\ntype I_close interface {\n\tClose() (Object, error)\n}\n```\n\n```go\ntype I_generator interface {\n\tI_iterator\n\tI_send\n\tI_throw\n\tI_close\n}\n```\nInterface all generators must satisfy\n\n```go\ntype I_iterator interface {\n\tI__iter__\n\tI__next__\n}\n```\nInterface all iterators must satisfy\n\n```go\ntype I_send interface {\n\tSend(value Object) (Object, error)\n}\n```\nGenerator interfaces\n\n```go\ntype I_throw interface {\n\tThrow(args Tuple, kwargs StringDict) (Object, error)\n}\n```\n\n```go\ntype InitFunc func(self Object, args Tuple, kwargs StringDict) error\n```\n\n```go\ntype Int int64\n```\n\n```go\nfunc GetInt(obj Object) (Int, error)\n```\nGetInt is a high-level convenience function that converts the given value to an int.\n\n```go\nfunc GetLen(obj Object) (Int, error)\n```\nGetLen is a high-level convenience function that returns the length of the given Object.\n\n```go\nfunc Index(a Object) (Int, error)\n```\nIndex the python Object returning an Int\n\nWill raise TypeError if Index can't be run on this object\n\n```go\nfunc (x Int) GoInt() (int, error)\n```\nTruncates to go int\n\nIf it is outside the range of an go int it will return an error\n\n```go\nfunc (x Int) GoInt64() (int64, error)\n```\nTruncates to go int64\n\nIf it is outside the range of an go int64 it will return an error\n\n```go\nfunc (a Int) M__abs__() (Object, error)\n```\n\n```go\nfunc (a Int) M__add__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__and__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__bool__() (Object, error)\n```\n\n```go\nfunc (a Int) M__ceil__() (Object, error)\n```\n\n```go\nfunc (a Int) M__complex__() (Object, error)\n```\n\n```go\nfunc (a Int) M__divmod__(other Object) (Object, Object, error)\n```\n\n```go\nfunc (a Int) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__float__() (Object, error)\n```\n\n```go\nfunc (a Int) M__floor__() (Object, error)\n```\n\n```go\nfunc (a Int) M__floordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__ge__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__gt__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__iadd__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__iand__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__ifloordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__ilshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__imod__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__imul__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__index__() (Int, error)\n```\n\n```go\nfunc (a Int) M__int__() (Object, error)\n```\n\n```go\nfunc (a Int) M__invert__() (Object, error)\n```\n\n```go\nfunc (a Int) M__ior__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__ipow__(other, modulus Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__irshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__isub__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__itruediv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__ixor__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__le__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__lshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__lt__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__mod__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__mul__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__neg__() (Object, error)\n```\n\n```go\nfunc (a Int) M__or__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__pos__() (Object, error)\n```\n\n```go\nfunc (a Int) M__pow__(other, modulus Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__radd__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rand__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rdivmod__(other Object) (Object, Object, error)\n```\n\n```go\nfunc (a Int) M__repr__() (Object, error)\n```\n\n```go\nfunc (a Int) M__rfloordiv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rlshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rmod__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rmul__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__ror__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__round__(digits Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rpow__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rrshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rshift__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rsub__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rtruediv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__rxor__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__str__() (Object, error)\n```\n\n```go\nfunc (a Int) M__sub__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__truediv__(other Object) (Object, error)\n```\n\n```go\nfunc (a Int) M__trunc__() (Object, error)\n```\n\n```go\nfunc (a Int) M__xor__(other Object) (Object, error)\n```\n\n```go\nfunc (o Int) Type() *Type\n```\nType of this Int object\n\n```go\ntype InternalMethod int\n```\nInternal method types implemented within eval.go\n\n```go\nconst (\n\tInternalMethodNone InternalMethod = iota\n\tInternalMethodGlobals\n\tInternalMethodLocals\n\tInternalMethodImport\n\tInternalMethodEval\n\tInternalMethodExec\n)\n```\n\n```go\ntype Iterator struct {\n\tPos int\n\tSeq Object\n}\n```\nA python Iterator object\n\n```go\nfunc NewIterator(Seq Object) *Iterator\n```\nDefine a new iterator\n\n```go\nfunc (it *Iterator) M__iter__() (Object, error)\n```\n\n```go\nfunc (it *Iterator) M__next__() (res Object, err error)\n```\nGet next one from the iteration\n\n```go\nfunc (o *Iterator) Type() *Type\n```\nType of this object\n\n```go\ntype List struct {\n\tItems []Object\n}\n```\nFIXME lists are mutable so this should probably be struct { Tuple } then can use the sub methods on Tuple\n\n```go\nfunc NewList() *List\n```\nMake a new empty list\n\n```go\nfunc NewListFromItems(items []Object) *List\n```\nMake a new list from an \\[]Object\n\nThe \\[]Object is copied into the list\n\n```go\nfunc NewListFromStrings(items []string) *List\n```\nMakes an argv into a tuple\n\n```go\nfunc NewListSized(n int) *List\n```\nMake a list with n nil elements\n\n```go\nfunc NewListWithCapacity(n int) *List\n```\nMake a new empty list with given capacity\n\n```go\nfunc SequenceList(v Object) (*List, error)\n```\nConverts a sequence object v into a List\n\n```go\nfunc (l *List) Append(item Object)\n```\nAppend an item\n\n```go\nfunc (l *List) Copy() *List\n```\nCopy a list object\n\n```go\nfunc (a *List) DelItem(i int)\n```\nRemoves the item at i\n\n```go\nfunc (l *List) Extend(items []Object)\n```\nExtend the list with items\n\n```go\nfunc (l *List) ExtendSequence(seq Object) error\n```\nExtends the list with the sequence passed in\n\n```go\nfunc (l *List) ExtendWithStrings(items []string)\n```\nExtend the list with strings\n\n```go\nfunc (l *List) Len() int\n```\nLen of list\n\n```go\nfunc (a *List) M__add__(other Object) (Object, error)\n```\n\n```go\nfunc (l *List) M__bool__() (Object, error)\n```\n\n```go\nfunc (a *List) M__delitem__(key Object) (Object, error)\n```\nRemoves items from a list\n\n```go\nfunc (a *List) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (l *List) M__getitem__(key Object) (Object, error)\n```\n\n```go\nfunc (a *List) M__iadd__(other Object) (Object, error)\n```\n\n```go\nfunc (a *List) M__imul__(other Object) (Object, error)\n```\n\n```go\nfunc (l *List) M__iter__() (Object, error)\n```\n\n```go\nfunc (l *List) M__len__() (Object, error)\n```\n\n```go\nfunc (l *List) M__mul__(other Object) (Object, error)\n```\n\n```go\nfunc (a *List) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a *List) M__radd__(other Object) (Object, error)\n```\n\n```go\nfunc (l *List) M__repr__() (Object, error)\n```\n\n```go\nfunc (a *List) M__rmul__(other Object) (Object, error)\n```\n\n```go\nfunc (l *List) M__setitem__(key, value Object) (Object, error)\n```\n\n```go\nfunc (l *List) M__str__() (Object, error)\n```\n\n```go\nfunc (l *List) Resize(newSize int)\n```\nResize the list\n\n```go\nfunc (o *List) Type() *Type\n```\nType of this List object\n\n```go\ntype Map struct {\n\t// contains filtered or unexported fields\n}\n```\nA python Map object\n\n```go\nfunc (m *Map) M__iter__() (Object, error)\n```\n\n```go\nfunc (m *Map) M__next__() (Object, error)\n```\n\n```go\nfunc (m *Map) Type() *Type\n```\nType of this object\n\n```go\ntype Method struct {\n\t// Name of this function\n\tName string\n\t// Doc string\n\tDoc string\n\t// Flags - see METH_* flags\n\tFlags int\n\n\t// Parent module of this method\n\tModule *Module\n\t// contains filtered or unexported fields\n}\n```\nA python Method object\n\n```go\nfunc MustNewMethod(name string, method interface{}, flags int, doc string) *Method\n```\nAs NewMethod but panics on error\n\n```go\nfunc NewMethod(name string, method interface{}, flags int, doc string) (*Method, error)\n```\nDefine a new method\n\n```go\nfunc (m *Method) Call(self Object, args Tuple) (Object, error)\n```\nCall the method with the given arguments\n\n```go\nfunc (m *Method) CallWithKeywords(self Object, args Tuple, kwargs StringDict) (Object, error)\n```\nCall the method with the given arguments\n\n```go\nfunc (m *Method) Internal() InternalMethod\n```\nReturns the InternalMethod type of this method\n\n```go\nfunc (m *Method) M__call__(args Tuple, kwargs StringDict) (Object, error)\n```\nCall a method\n\n```go\nfunc (m *Method) M__eq__(other Object) (Object, error)\n```\nFIXME this should be the default?\n\n```go\nfunc (m *Method) M__get__(instance, owner Object) (Object, error)\n```\nRead a method from a class which makes a bound method\n\n```go\nfunc (m *Method) M__ne__(other Object) (Object, error)\n```\nFIXME this should be the default?\n\n```go\nfunc (o *Method) Type() *Type\n```\nType of this object\n\n```go\ntype Module struct {\n\tModuleImpl *ModuleImpl // Parent implementation of this Module instance\n\tGlobals    StringDict  // Initialized from ModuleImpl.Globals\n\tContext    Context     // Parent context that \"owns\" this Module instance\n}\n```\nModule is a runtime instance of a ModuleImpl bound to the py.Context that imported it.\n\n```go\nfunc RunCode(ctx Context, code *Code, codeDesc string, inModule interface{}) (*Module, error)\n```\nRunCode executes the given code object within the given module and returns the Module to indicate success.\n\nIf inModule is a \\*Module, then the code is run in that module.\n\nIf inModule is nil, the code is run in a new \\_\\_main\\_\\_ module (and the new Module is returned).\n\nIf inModule is a string, the code is run in a new module with the given name (and the new Module is returned).\n\n```go\nfunc RunFile(ctx Context, pathname string, opts CompileOpts, inModule interface{}) (*Module, error)\n```\nRunFile resolves the given pathname, compiles as needed, executes the code in the given module, and returns the Module to indicate success.\n\nSee RunCode() for description of inModule.\n\n```go\nfunc RunSrc(ctx Context, pySrc string, pySrcDesc string, inModule interface{}) (*Module, error)\n```\nRunSrc compiles the given python buffer and executes it within the given module and returns the Module to indicate success.\n\nSee RunCode() for description of inModule.\n\n```go\nfunc (m *Module) Call(name string, args Tuple, kwargs StringDict) (Object, error)\n```\nCalls a named method of a module\n\n```go\nfunc (m *Module) GetDict() StringDict\n```\nGet the Dict\n\n```go\nfunc (m *Module) M__repr__() (Object, error)\n```\n\n```go\nfunc (o *Module) Type() *Type\n```\nType of this object\n\n```go\ntype ModuleFlags int32\n```\n\n```go\nconst (\n\t// ShareModule signals that an embedded module is threadsafe and read-only, meaninging it could be shared across multiple py.Context instances (for efficiency).\n\t// Otherwise, ModuleImpl will create a separate py.Module instance for each py.Context that imports it.\n\t// This should be used with extreme caution since any module mutation (write) means possible cross-context data corruption.\n\tShareModule ModuleFlags = 0x01\n\n\tMainModuleName = \"__main__\"\n)\n```\n\n```go\ntype ModuleImpl struct {\n\tInfo            ModuleInfo\n\tMethods         []*Method     // Module-bound global method functions\n\tGlobals         StringDict    // Module-bound global variables\n\tCodeSrc         string        // Module code body (source code to be compiled)\n\tCodeBuf         []byte        // Module code body (serialized py.Code object)\n\tCode            *Code         // Module code body\n\tOnContextClosed func(*Module) // Callback for when a py.Context is closing to release resources\n}\n```\nModuleImpl is used for modules that are ready to be imported into a py.Context. The model is that a ModuleImpl is read-only and instantiates a Module into a py.Context when imported.\n\nBy convention, .Code is executed when a module instance is initialized. If nil, then .CodeBuf or .CodeSrc will be auto-compiled to set .Code.\n\n```go\nfunc GetModuleImpl(moduleName string) *ModuleImpl\n```\n\n```go\ntype ModuleInfo struct {\n\tName     string // __name__ (if nil, \"__main__\" is used)\n\tDoc      string // __doc__\n\tFileDesc string // __file__\n\tFlags    ModuleFlags\n}\n```\nModuleInfo contains info and about a module and can specify flags that affect how it is imported into a py.Context\n\n```go\ntype ModuleStore struct {\n\n\t// Builtin module\n\tBuiltins *Module\n\t// this should be the frozen module importlib/_bootstrap.py generated\n\t// by Modules/_freeze_importlib.c into Python/importlib.h\n\tImportlib *Module\n\t// contains filtered or unexported fields\n}\n```\nModuleStore is a container of Module imported into an owning py.Context.\n\n```go\nfunc NewModuleStore() *ModuleStore\n```\n\n```go\nfunc (store *ModuleStore) GetModule(name string) (*Module, error)\n```\nGets a module\n\n```go\nfunc (store *ModuleStore) MustGetModule(name string) *Module\n```\nGets a module or panics\n\n```go\nfunc (store *ModuleStore) NewModule(ctx Context, impl *ModuleImpl) (*Module, error)\n```\nNewModule adds a new Module instance to this ModuleStore. Each given Method prototype is used to create a new \"live\" Method bound this the newly created Module. This func also sets appropriate module global attribs based on the given ModuleInfo (e.g. \\_\\_name\\_\\_).\n\n```go\nfunc (store *ModuleStore) OnContextClosed()\n```\nOnContextClosed signals all module instances that the parent py.Context has closed\n\n```go\ntype NewFunc func(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\n\n```go\ntype NoneType struct{}\n```\n\n```go\nfunc (a NoneType) M__bool__() (Object, error)\n```\n\n```go\nfunc (a NoneType) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (a NoneType) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a NoneType) M__repr__() (Object, error)\n```\n\n```go\nfunc (a NoneType) M__str__() (Object, error)\n```\n\n```go\nfunc (s NoneType) Type() *Type\n```\nType of this object\n\n```go\ntype Object interface {\n\tType() *Type\n}\n```\nA python object\n\n```go\nfunc Abs(a Object) (Object, error)\n```\nAbs the python Object returning an Object\n\nWill raise TypeError if Abs can't be run on this object\n\n```go\nfunc Add(a, b Object) (Object, error)\n```\nAdd two python objects together returning an Object\n\nWill raise TypeError if can't be add can't be run on these objects\n\n```go\nfunc And(a, b Object) (Object, error)\n```\nAnd two python objects together returning an Object\n\nWill raise TypeError if can't be and can't be run on these objects\n\n```go\nfunc BuiltinImport(ctx Context, self Object, args Tuple, kwargs StringDict, currentGlobal StringDict) (Object, error)\n```\nThe actual import code\n\n```go\nfunc BytesNew(metatype *Type, args Tuple, kwargs StringDict) (res Object, err error)\n```\nBytesNew\n\n```go\nfunc Call(fn Object, args Tuple, kwargs StringDict) (Object, error)\n```\nCalls function fnObj with args and kwargs in a new vm (or directly if Go code)\n\nkwargs should be nil if not required\n\nfnObj must be a callable type such as \\*py.Method or \\*py.Function\n\nThe result is returned\n\n```go\nfunc ClassMethodNew(metatype *Type, args Tuple, kwargs StringDict) (res Object, err error)\n```\nClassMethodNew\n\n```go\nfunc ComplexNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nComplexNew\n\n```go\nfunc DelItem(self Object, key Object) (Object, error)\n```\nDelitem\n\n```go\nfunc DictNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nDictNew\n\n```go\nfunc EnumerateNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nEnumerateTypeNew\n\n```go\nfunc Eq(a Object, b Object) (Object, error)\n```\nEq two python objects returning a boolean result\n\nWill raise TypeError if Eq can't be run on this object\n\n```go\nfunc ExceptionNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nExceptionNew\n\n```go\nfunc FilterTypeNew(metatype *Type, args Tuple, kwargs StringDict) (res Object, err error)\n```\nFilterTypeNew\n\n```go\nfunc FloatFromString(str string) (Object, error)\n```\nFloatFromString turns a string into a Float\n\n```go\nfunc FloatNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nFloatNew\n\n```go\nfunc FloorDiv(a, b Object) (Object, error)\n```\nFloorDiv two python objects together returning an Object\n\nWill raise TypeError if can't be floordiv can't be run on these objects\n\n```go\nfunc Ge(a Object, b Object) (Object, error)\n```\nGe two python objects returning a boolean result\n\nWill raise TypeError if Ge can't be run on this object\n\n```go\nfunc GetAttr(self Object, keyObj Object) (res Object, err error)\n```\nGetAttrErr - returns the result or an err to be raised if not found\n\nIf not found an AttributeError will be returned\n\n```go\nfunc GetAttrString(self Object, key string) (res Object, err error)\n```\nGetAttrString - returns the result or an err to be raised if not found\n\nIf not found err will be an AttributeError\n\n```go\nfunc GetItem(self Object, key Object) (Object, error)\n```\nGetItem\n\n```go\nfunc Gt(a Object, b Object) (Object, error)\n```\nGt two python objects returning a boolean result\n\nWill raise TypeError if Gt can't be run on this object\n\n```go\nfunc IAdd(a, b Object) (Object, error)\n```\nInplace add\n\n```go\nfunc IAnd(a, b Object) (Object, error)\n```\nInplace and\n\n```go\nfunc IFloorDiv(a, b Object) (Object, error)\n```\nInplace floordiv\n\n```go\nfunc ILshift(a, b Object) (Object, error)\n```\nInplace lshift\n\n```go\nfunc IMod(a, b Object) (Object, error)\n```\nInplace mod\n\n```go\nfunc IMul(a, b Object) (Object, error)\n```\nInplace mul\n\n```go\nfunc IOr(a, b Object) (Object, error)\n```\nInplace or\n\n```go\nfunc IPow(a, b, c Object) (Object, error)\n```\nInplace pow\n\n```go\nfunc IRshift(a, b Object) (Object, error)\n```\nInplace rshift\n\n```go\nfunc ISub(a, b Object) (Object, error)\n```\nInplace sub\n\n```go\nfunc ITrueDiv(a, b Object) (Object, error)\n```\nInplace truediv\n\n```go\nfunc IXor(a, b Object) (Object, error)\n```\nInplace xor\n\n```go\nfunc ImportModuleLevelObject(ctx Context, name string, globals, locals StringDict, fromlist Tuple, level int) (Object, error)\n```\nThe workings of \\_\\_import\\_\\_\n\n\\_\\_import\\_\\_(name, globals=None, locals=None, fromlist=(), level=0)\n\nThis function is invoked by the import statement. It can be replaced (by importing the builtins module and assigning to builtins.\\_\\_import\\_\\_) in order to change semantics of the import statement, but doing so is strongly discouraged as it is usually simpler to use import hooks (see PEP 302) to attain the same goals and does not cause issues with code which assumes the default import implementation is in use. Direct use of \\_\\_import\\_\\_() is also discouraged in favor of importlib.import\\_module().\n\nThe function imports the module name, potentially using the given globals and locals to determine how to interpret the name in a package context. The fromlist gives the names of objects or submodules that should be imported from the module given by name. The standard implementation does not use its locals argument at all, and uses its globals only to determine the package context of the import statement.\n\nlevel specifies whether to use absolute or relative imports. 0 (the default) means only perform absolute imports. Positive values for level indicate the number of parent directories to search relative to the directory of the module calling \\_\\_import\\_\\_() (see PEP 328 for the details).\n\nWhen the name variable is of the form package.module, normally, the top-level package (the name up till the first dot) is returned, not the module named by name. However, when a non-empty fromlist argument is given, the module named by name is returned.\n\nFor example, the statement import spam results in bytecode resembling the following code:\n\nspam = \\_\\_import\\_\\_('spam', globals(), locals(), \\[], 0) The statement import spam.ham results in this call:\n\nspam = \\_\\_import\\_\\_('spam.ham', globals(), locals(), \\[], 0)\n\nNote how \\_\\_import\\_\\_() returns the toplevel module here because this is the object that is bound to a name by the import statement.\n\nOn the other hand, the statement from spam.ham import eggs, sausage as saus results in\n\n\\_temp = \\_\\_import\\_\\_('spam.ham', globals(), locals(), \\['eggs', 'sausage'], 0) eggs = \\_temp.eggs saus = \\_temp.sausage\n\nHere, the spam.ham module is returned from \\_\\_import\\_\\_(). From this object, the names to import are retrieved and assigned to their respective names.\n\nIf you simply want to import a module (potentially within a package) by name, use importlib.import\\_module().\n\nChanged in version 3.3: Negative values for level are no longer supported (which also changes the default value to 0).\n\n```go\nfunc IntFromString(str string, base int) (Object, error)\n```\nCreate an Int (or BigInt) from the string passed in\n\nFIXME check this is 100% python compatible\n\n```go\nfunc IntNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nIntNew\n\n```go\nfunc Invert(a Object) (Object, error)\n```\nInvert the python Object returning an Object\n\nWill raise TypeError if Invert can't be run on this object\n\n```go\nfunc Iter(self Object) (res Object, err error)\n```\nReturns an iterator object\n\nCall \\_\\_Iter\\_\\_ Returns an iterator object\n\nIf object is sequence object, create an iterator\n\n```go\nfunc Le(a Object, b Object) (Object, error)\n```\nLe two python objects returning a boolean result\n\nWill raise TypeError if Le can't be run on this object\n\n```go\nfunc Len(self Object) (Object, error)\n```\nReturns the number of items of a sequence or mapping\n\n```go\nfunc ListNew(metatype *Type, args Tuple, kwargs StringDict) (res Object, err error)\n```\nListNew\n\n```go\nfunc Lshift(a, b Object) (Object, error)\n```\nLshift two python objects together returning an Object\n\nWill raise TypeError if can't be lshift can't be run on these objects\n\n```go\nfunc Lt(a Object, b Object) (Object, error)\n```\nLt two python objects returning a boolean result\n\nWill raise TypeError if Lt can't be run on this object\n\n```go\nfunc MakeBool(a Object) (Object, error)\n```\nBool is called to implement truth value testing and the built-in operation bool(); should return False or True. When this method is not defined, \\_\\_len\\_\\_() is called, if it is defined, and the object is considered true if its result is nonzero. If a class defines neither \\_\\_len\\_\\_() nor \\_\\_bool\\_\\_(), all its instances are considered true.\n\n```go\nfunc MakeComplex(a Object) (Object, error)\n```\nMakeComplex the python Object returning an Object\n\nWill raise TypeError if MakeComplex can't be run on this object\n\n```go\nfunc MakeFloat(a Object) (Object, error)\n```\nMakeFloat the python Object returning an Object\n\nWill raise TypeError if MakeFloat can't be run on this object\n\n```go\nfunc MakeInt(a Object) (Object, error)\n```\nMakeInt the python Object returning an Object\n\nWill raise TypeError if MakeInt can't be run on this object\n\n```go\nfunc MapTypeNew(metatype *Type, args Tuple, kwargs StringDict) (res Object, err error)\n```\nMapType\n\n```go\nfunc Mod(a, b Object) (Object, error)\n```\nMod two python objects together returning an Object\n\nWill raise TypeError if can't be mod can't be run on these objects\n\n```go\nfunc Mul(a, b Object) (Object, error)\n```\nMul two python objects together returning an Object\n\nWill raise TypeError if can't be mul can't be run on these objects\n\n```go\nfunc Ne(a Object, b Object) (Object, error)\n```\nNe two python objects returning a boolean result\n\nWill raise TypeError if Ne can't be run on this object\n\n```go\nfunc Neg(a Object) (Object, error)\n```\nNeg the python Object returning an Object\n\nWill raise TypeError if Neg can't be run on this object\n\n```go\nfunc Next(self Object) (obj Object, err error)\n```\nCall \\_\\_next\\_\\_ for the python object\n\n### Returns the next object {#hdr-Returns_the_next_object}\n\nerr == StopIteration or subclass when finished\n\n```go\nfunc Not(a Object) (Object, error)\n```\nReturn the result of not a\n\n```go\nfunc ObjectGetAttr(o Object, attr string) Object\n```\nGets the attribute attr from object or returns nil\n\n```go\nfunc ObjectNew(t *Type, args Tuple, kwargs StringDict) (Object, error)\n```\n\n```go\nfunc ObjectRepr(o Object) Object\n```\nGets the repr for an object\n\n```go\nfunc OpenFile(filename, mode string, buffering int) (Object, error)\n```\n\n```go\nfunc Or(a, b Object) (Object, error)\n```\nOr two python objects together returning an Object\n\nWill raise TypeError if can't be or can't be run on these objects\n\n```go\nfunc Pos(a Object) (Object, error)\n```\nPos the python Object returning an Object\n\nWill raise TypeError if Pos can't be run on this object\n\n```go\nfunc Pow(a, b, c Object) (Object, error)\n```\nPow three python objects together returning an Object\n\nIf c != None then it won't attempt to call \\_\\_rpow\\_\\_\n\nWill raise TypeError if can't be pow can't be run on these objects\n\n```go\nfunc RangeNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nRangeNew\n\n```go\nfunc Repr(self Object) (Object, error)\n```\nCalls \\_\\_str\\_\\_ on the object\n\nCalls \\_\\_repr\\_\\_ on the object or returns a sensible default\n\n```go\nfunc Rshift(a, b Object) (Object, error)\n```\nRshift two python objects together returning an Object\n\nWill raise TypeError if can't be rshift can't be run on these objects\n\n```go\nfunc Send(self, value Object) (Object, error)\n```\nCall send for the python object\n\n```go\nfunc SetAttr(self Object, keyObj Object, value Object) (Object, error)\n```\nSetAttr\n\n```go\nfunc SetAttrString(self Object, key string, value Object) (Object, error)\n```\nSetAttrString\n\n```go\nfunc SetItem(self Object, key Object, value Object) (Object, error)\n```\nSetItem\n\n```go\nfunc SetNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nSetNew\n\n```go\nfunc SliceNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nSliceNew\n\n```go\nfunc StaticMethodNew(metatype *Type, args Tuple, kwargs StringDict) (res Object, err error)\n```\nStaticMethodNew\n\n```go\nfunc Str(self Object) (Object, error)\n```\nCalls \\_\\_str\\_\\_ on the object and if not found calls \\_\\_repr\\_\\_\n\n```go\nfunc StrNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nStrNew\n\n```go\nfunc Sub(a, b Object) (Object, error)\n```\nSub two python objects together returning an Object\n\nWill raise TypeError if can't be sub can't be run on these objects\n\n```go\nfunc TrueDiv(a, b Object) (Object, error)\n```\nTrueDiv two python objects together returning an Object\n\nWill raise TypeError if can't be truediv can't be run on these objects\n\n```go\nfunc TupleNew(metatype *Type, args Tuple, kwargs StringDict) (res Object, err error)\n```\nTupleNew\n\n```go\nfunc TypeCall(self Object, name string, args Tuple, kwargs StringDict) (Object, bool, error)\n```\nCalls a type method on obj\n\nIf obj isnt a \\*Type or the method isn't found on it returns (nil, false, nil)\n\nOtherwise returns (object, true, err)\n\nMay raise exceptions if calling the method fails\n\n```go\nfunc TypeCall0(self Object, name string) (Object, bool, error)\n```\nCalls TypeCall with 0 arguments\n\n```go\nfunc TypeCall1(self Object, name string, arg Object) (Object, bool, error)\n```\nCalls TypeCall with 1 argument\n\n```go\nfunc TypeCall2(self Object, name string, arg1, arg2 Object) (Object, bool, error)\n```\nCalls TypeCall with 2 arguments\n\n```go\nfunc TypeNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nCreate a new type\n\n```go\nfunc XImportModuleLevelObject(ctx Context, nameObj, given_globals, locals, given_fromlist Object, level int) (Object, error)\n```\nStraight port of the python code\n\nThis calls functins from \\_bootstrap.py which is a frozen module\n\nToo much functionality for the moment\n\n```go\nfunc Xor(a, b Object) (Object, error)\n```\nXor two python objects together returning an Object\n\nWill raise TypeError if can't be xor can't be run on these objects\n\n```go\nfunc ZipTypeNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error)\n```\nZipTypeNew\n\n```go\ntype Property struct {\n\tFget func(self Object) (Object, error)\n\tFset func(self, value Object) error\n\tFdel func(self Object) error\n\tDoc  string\n}\n```\nA python Property object\n\n```go\nfunc (p *Property) M__delete__(instance Object) (Object, error)\n```\n\n```go\nfunc (p *Property) M__get__(instance, owner Object) (Object, error)\n```\n\n```go\nfunc (p *Property) M__set__(instance, value Object) (Object, error)\n```\n\n```go\nfunc (o *Property) Type() *Type\n```\nType of this object\n\n```go\ntype PyCFunction func(self Object, args Tuple) (Object, error)\n```\nCalled with self and a tuple of args\n\n```go\ntype PyCFunction1Arg func(Object, Object) (Object, error)\n```\nCalled with one (unnamed) parameter only\n\n```go\ntype PyCFunctionNoArgs func(Object) (Object, error)\n```\nCalled with self only\n\n```go\ntype PyCFunctionWithKeywords func(self Object, args Tuple, kwargs StringDict) (Object, error)\n```\nCalled with self, a tuple of args and a stringdic of kwargs\n\n```go\ntype Range struct {\n\tStart  Int\n\tStop   Int\n\tStep   Int\n\tLength Int\n}\n```\nA python Range object FIXME one day support BigInts too!\n\n```go\nfunc (a *Range) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (r *Range) M__getitem__(key Object) (Object, error)\n```\n\n```go\nfunc (r *Range) M__iter__() (Object, error)\n```\nMake a range iterator from a range\n\n```go\nfunc (r *Range) M__len__() (Object, error)\n```\n\n```go\nfunc (a *Range) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (r *Range) M__repr__() (Object, error)\n```\n\n```go\nfunc (r *Range) M__str__() (Object, error)\n```\n\n```go\nfunc (o *Range) Type() *Type\n```\nType of this object\n\n```go\ntype RangeIterator struct {\n\tRange\n\tIndex Int\n}\n```\nA python Range iterator\n\n```go\nfunc (it *RangeIterator) M__iter__() (Object, error)\n```\nRange iterator\n\n```go\nfunc (it *RangeIterator) M__next__() (Object, error)\n```\nRange iterator next\n\n```go\nfunc (o *RangeIterator) Type() *Type\n```\nType of this object\n\n```go\ntype Runtime struct {\n\tModuleImpls map[string]*ModuleImpl\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (rt *Runtime) RegisterModule(impl *ModuleImpl)\n```\n\n```go\ntype Set struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewSet() *Set\n```\nMake a new empty set\n\n```go\nfunc NewSetFromItems(items []Object) *Set\n```\nMake a new set with the items passed in\n\n```go\nfunc NewSetWithCapacity(n int) *Set\n```\nMake a new empty set with capacity for n items\n\n```go\nfunc SequenceSet(v Object) (*Set, error)\n```\nConverts a sequence object v into a Set\n\n```go\nfunc (s *Set) Add(item Object)\n```\nAdd an item to the set\n\n```go\nfunc (s *Set) M__and__(other Object) (Object, error)\n```\n\n```go\nfunc (s *Set) M__bool__() (Object, error)\n```\n\n```go\nfunc (a *Set) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (s *Set) M__iter__() (Object, error)\n```\n\n```go\nfunc (s *Set) M__len__() (Object, error)\n```\n\n```go\nfunc (a *Set) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (s *Set) M__or__(other Object) (Object, error)\n```\n\n```go\nfunc (s *Set) M__repr__() (Object, error)\n```\n\n```go\nfunc (s *Set) M__sub__(other Object) (Object, error)\n```\n\n```go\nfunc (s *Set) M__xor__(other Object) (Object, error)\n```\n\n```go\nfunc (o *Set) Type() *Type\n```\nType of this Set object\n\n```go\nfunc (s *Set) Update(items []Object)\n```\nExtend the set with items\n\n```go\ntype SetValue struct{}\n```\n\n```go\ntype Slice struct {\n\tStart Object\n\tStop  Object\n\tStep  Object\n}\n```\nA python Slice object\n\n```go\nfunc NewSlice(start, stop, step Object) *Slice\n```\nMake a new slice object\n\n```go\nfunc (r *Slice) GetIndices(length int) (start, stop, step, slicelength int, err error)\n```\nGetIndices\n\nRetrieve the start, stop, and step indices from the slice object slice assuming a sequence of length length, and store the length of the slice in slicelength. Out of bounds indices are clipped in a manner consistent with the handling of normal slices.\n\n```go\nfunc (a *Slice) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (a *Slice) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (o *Slice) Type() *Type\n```\nType of this object\n\n```go\ntype StaticMethod struct {\n\tCallable Object\n\tDict     StringDict\n}\n```\n\n```go\nfunc (c *StaticMethod) GetDict() StringDict\n```\nGet the Dict\n\n```go\nfunc (c *StaticMethod) M__get__(instance, owner Object) (Object, error)\n```\nRead a staticmethod from a class - no bound method here\n\n```go\nfunc (o StaticMethod) Type() *Type\n```\nType of this StaticMethod object\n\n```go\ntype String string\n```\n\n```go\nfunc (s String) Intern() String\n```\nIntern s possibly returning a reference to an already interned string\n\n```go\nfunc (s String) LStrip(args Tuple) (Object, error)\n```\n\n```go\nfunc (a String) M__add__(other Object) (Object, error)\n```\n\n```go\nfunc (s String) M__bool__() (Object, error)\n```\n\n```go\nfunc (s String) M__contains__(item Object) (Object, error)\n```\n\n```go\nfunc (a String) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__ge__(other Object) (Object, error)\n```\n\n```go\nfunc (s String) M__getitem__(key Object) (Object, error)\n```\n\n```go\nfunc (a String) M__gt__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__iadd__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__imod__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__imul__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__le__(other Object) (Object, error)\n```\n\n```go\nfunc (s String) M__len__() (Object, error)\n```\n\n```go\nfunc (a String) M__lt__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__mod__(other Object) (Object, error)\n```\n4\\.7.2. printf-style String Formatting\n\nNote The formatting operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly). Using the newer str.format() interface helps avoid these errors, and also provides a generally more powerful, flexible and extensible approach to formatting text.\n\nString objects have one unique built-in operation: the % operator (modulo). This is also known as the string formatting or interpolation operator. Given format % values (where format is a string), % conversion specifications in format are replaced with zero or more elements of values. The effect is similar to using the sprintf() in the C language.\n\nIf format requires a single argument, values may be a single non-tuple object. \\[5] Otherwise, values must be a tuple with exactly the number of items specified by the format string, or a single mapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the following components, which must occur in this order:\n\nThe '%' character, which marks the start of the specifier.\n\nMapping key (optional), consisting of a parenthesised sequence of characters (for example, (somename)).\n\nConversion flags (optional), which affect the result of some conversion types.\n\nMinimum field width (optional). If specified as an '\\*' (asterisk), the actual width is read from the next element of the tuple in values, and the object to convert comes after the minimum field width and optional precision.\n\nPrecision (optional), given as a '.' (dot) followed by the precision. If specified as '\\*' (an asterisk), the actual precision is read from the next element of the tuple in values, and the value to convert comes after the precision.\n\nLength modifier (optional).\n\nConversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then the formats in the string must include a parenthesised mapping key into that dictionary inserted immediately after the '%' character. The mapping key selects the value to be formatted from the mapping. For example:\n\n\u003e\u003e\u003e \u003e\u003e\u003e print('%(language)s has %(number)03d quote types.' % ...       {'language': \"Python\", \"number\": 2}) Python has 002 quote types.\n\nIn this case no \\* specifiers may occur in a format (since they require a sequential parameter list).\n\nThe conversion flag characters are:\n\nFlag\tMeaning '#'\tThe value conversion will use the “alternate form” (where defined below). '0'\tThe conversion will be zero padded for numeric values. '-'\tThe converted value is left adjusted (overrides the '0' conversion if both are given). ' '\t(a space) A blank should be left before a positive number (or empty string) produced by a signed conversion. '+'\tA sign character ('+' or '-') will precede the conversion (overrides a “space” flag).\n\nA length modifier (h, l, or L) may be present, but is ignored as it is not necessary for Python – so e.g. %ld is identical to %d.\n\nThe conversion types are:\n\nConversion\tMeaning\tNotes 'd'\tSigned integer decimal. 'i'\tSigned integer decimal. 'o'\tSigned octal value.\t(1) 'u'\tObsolete type – it is identical to 'd'.\t(7) 'x'\tSigned hexadecimal (lowercase).\t(2) 'X'\tSigned hexadecimal (uppercase).\t(2) 'e'\tFloating point exponential format (lowercase).\t(3) 'E'\tFloating point exponential format (uppercase).\t(3) 'f'\tFloating point decimal format.\t(3) 'F'\tFloating point decimal format.\t(3) 'g'\tFloating point format. Uses lowercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise.\t(4) 'G'\tFloating point format. Uses uppercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise.\t(4) 'c'\tSingle character (accepts integer or single character string). 'r'\tString (converts any Python object using repr()).\t(5) 's'\tString (converts any Python object using str()).\t(5) 'a'\tString (converts any Python object using ascii()).\t(5) '%'\tNo argument is converted, results in a '%' character in the result. Notes:\n\nThe alternate form causes a leading zero ('0') to be inserted between left-hand padding and the formatting of the number if the leading character of the result is not already a zero.\n\nThe alternate form causes a leading '0x' or '0X' (depending on whether the 'x' or 'X' format was used) to be inserted between left-hand padding and the formatting of the number if the leading character of the result is not already a zero.\n\nThe alternate form causes the result to always contain a decimal point, even if no digits follow it.\n\nThe precision determines the number of digits after the decimal point and defaults to 6.\n\nThe alternate form causes the result to always contain a decimal point, and trailing zeroes are not removed as they would otherwise be.\n\nThe precision determines the number of significant digits before and after the decimal point and defaults to 6.\n\nIf precision is N, the output is truncated to N characters.\n\nSee PEP 237.  Since Python strings have an explicit length, %s conversions do not assume that '\\\\0' is the end of the string.\n\nChanged in version 3.1: %f conversions for numbers whose absolute value is over 1e50 are no longer replaced by %g conversions.\n\n```go\nfunc (a String) M__mul__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__radd__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__repr__() (Object, error)\n```\n\n```go\nfunc (a String) M__rmod__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__rmul__(other Object) (Object, error)\n```\n\n```go\nfunc (a String) M__str__() (Object, error)\n```\n\n```go\nfunc (s String) RStrip(args Tuple) (Object, error)\n```\n\n```go\nfunc (s String) Replace(args Tuple) (Object, error)\n```\n\n```go\nfunc (s String) Split(args Tuple, kwargs StringDict) (Object, error)\n```\n\n```go\nfunc (s String) Strip(args Tuple) (Object, error)\n```\n\n```go\nfunc (s String) Type() *Type\n```\nType of this object\n\n```go\ntype StringDict map[string]Object\n```\nString to object dictionary\n\nUsed for variables etc where the keys can only be strings\n\n```go\nfunc DictCheck(obj Object) (StringDict, error)\n```\nChecks that obj is exactly a dictionary and returns an error if not\n\n```go\nfunc DictCheckExact(obj Object) (StringDict, error)\n```\nChecks that obj is exactly a dictionary and returns an error if not\n\n```go\nfunc NewStringDict() StringDict\n```\nMake a new dictionary\n\n```go\nfunc NewStringDictSized(n int) StringDict\n```\nMake a new dictionary with reservation for n entries\n\n```go\nfunc (d StringDict) Copy() StringDict\n```\nCopy a dictionary\n\n```go\nfunc (d StringDict) GetDict() StringDict\n```\n\n```go\nfunc (a StringDict) M__contains__(other Object) (Object, error)\n```\n\n```go\nfunc (d StringDict) M__delitem__(key Object) (Object, error)\n```\n\n```go\nfunc (a StringDict) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (d StringDict) M__getitem__(key Object) (Object, error)\n```\n\n```go\nfunc (d StringDict) M__iter__() (Object, error)\n```\nReturns a list of keys from the dict\n\n```go\nfunc (a StringDict) M__len__() (Object, error)\n```\n\n```go\nfunc (a StringDict) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a StringDict) M__repr__() (Object, error)\n```\n\n```go\nfunc (d StringDict) M__setitem__(key, value Object) (Object, error)\n```\n\n```go\nfunc (a StringDict) M__str__() (Object, error)\n```\n\n```go\nfunc (o StringDict) Type() *Type\n```\nType of this StringDict object\n\n```go\ntype Traceback struct {\n\tNext   *Traceback\n\tFrame  *Frame\n\tLasti  int32\n\tLineno int32\n}\n```\nA python Traceback object\n\n```go\nfunc NewTraceback(next *Traceback, frame *Frame, lasti, lineno int32) *Traceback\n```\nMake a new traceback\n\n```go\nfunc (tb *Traceback) TracebackDump(w io.Writer)\n```\nDump a traceback for tb to w\n\n```go\nfunc (o *Traceback) Type() *Type\n```\nType of this object\n\n```go\ntype TryBlock struct {\n\tType    TryBlockType // what kind of block this is\n\tHandler int32        // where to jump to find handler\n\tLevel   int          // value stack level to pop to\n}\n```\nStore information about try blocks\n\n```go\ntype TryBlockType byte\n```\nWhat kind of block this is\n\n```go\nconst (\n\tTryBlockSetupLoop TryBlockType = iota\n\tTryBlockSetupExcept\n\tTryBlockSetupFinally\n\tTryBlockExceptHandler\n)\n```\n\n```go\ntype Tuple []Object\n```\n\n```go\nfunc SequenceTuple(v Object) (Tuple, error)\n```\nConverts a sequence object v into a Tuple\n\n```go\nfunc (t Tuple) Copy() Tuple\n```\nCopy a tuple object\n\n```go\nfunc (a Tuple) M__add__(other Object) (Object, error)\n```\n\n```go\nfunc (t Tuple) M__bool__() (Object, error)\n```\n\n```go\nfunc (a Tuple) M__eq__(other Object) (Object, error)\n```\n\n```go\nfunc (t Tuple) M__getitem__(key Object) (Object, error)\n```\n\n```go\nfunc (a Tuple) M__iadd__(other Object) (Object, error)\n```\n\n```go\nfunc (a Tuple) M__imul__(other Object) (Object, error)\n```\n\n```go\nfunc (t Tuple) M__iter__() (Object, error)\n```\n\n```go\nfunc (t Tuple) M__len__() (Object, error)\n```\n\n```go\nfunc (l Tuple) M__mul__(other Object) (Object, error)\n```\n\n```go\nfunc (a Tuple) M__ne__(other Object) (Object, error)\n```\n\n```go\nfunc (a Tuple) M__radd__(other Object) (Object, error)\n```\n\n```go\nfunc (t Tuple) M__repr__() (Object, error)\n```\n\n```go\nfunc (a Tuple) M__rmul__(other Object) (Object, error)\n```\n\n```go\nfunc (t Tuple) M__str__() (Object, error)\n```\n\n```go\nfunc (t Tuple) Reverse()\n```\nReverses a tuple (in-place)\n\n```go\nfunc (o Tuple) Type() *Type\n```\nType of this Tuple object\n\n```go\ntype Type struct {\n\tObjectType *Type  // Type of this object -- FIXME this is redundant in Base?\n\tName       string // For printing, in format \"\u003cmodule\u003e.\u003cname\u003e\"\n\tDoc        string // Documentation string\n\t//\tMethods    StringDict // *PyMethodDef\n\t//\tMembers    StringDict // *PyMemberDef\n\t//\tGetset     *PyGetSetDef\n\tBase *Type\n\tDict StringDict\n\t//\tDictoffset int\n\tBases Tuple\n\tMro   Tuple // method resolution order\n\t//\tCache      Object\n\t//\tSubclasses Tuple\n\t//\tWeaklist   Tuple\n\tNew      NewFunc\n\tInit     InitFunc\n\tFlags    uint // Flags to define presence of optional/expanded features\n\tQualname string\n}\n```\n\n```go\nvar TypeType *Type = \u0026Type{\n\tName: \"type\",\n\tDoc:  \"type(object) -\u003e the object's type\\ntype(name, bases, dict) -\u003e a new type\",\n\tDict: StringDict{},\n}\n```\n\n```go\nfunc NewType(Name string, Doc string) *Type\n```\nMake a new type from a name\n\nFor making Go types\n\n```go\nfunc NewTypeX(Name string, Doc string, New NewFunc, Init InitFunc) *Type\n```\nMake a new type with constructors\n\nFor making Go types\n\n```go\nfunc (t *Type) Alloc() *Type\n```\nGeneric object allocator\n\n```go\nfunc (metatype *Type) CalculateMetaclass(bases Tuple) (*Type, error)\n```\nDetermine the most derived metatype.\n\n```go\nfunc (t *Type) CallMethod(name string, args Tuple, kwargs StringDict) (Object, bool, error)\n```\nCalls method on name\n\nIf method not found returns (nil, false, nil)\n\nIf method found returns (object, true, err)\n\nMay raise exceptions if calling the method failed\n\n```go\nfunc (t *Type) Error() string\n```\nSatistfy error interface\n\n```go\nfunc (t *Type) GetAttrOrNil(name string) Object\n```\nGet an attribute from the type\n\nDoesn't call \\_\\_getattr\\_\\_ etc\n\n### Returns nil if not found {#hdr-Returns_nil_if_not_found}\n\nFIXME this isn't totally correct! as we are ignoring getattribute etc See \\_PyObject\\_GenericGetAttrWithDict in object.c\n\n```go\nfunc (t *Type) GetDict() StringDict\n```\nGet the Dict\n\n```go\nfunc (a *Type) IsSubtype(b *Type) bool\n```\ntype test with subclassing support reads a IsSubtype of b\n\n```go\nfunc (t *Type) Lookup(name string) Object\n```\nInternal API to look for a name through the MRO. This returns a borrowed reference, and doesn't set an exception, returning nil instead\n\n```go\nfunc (t *Type) M__call__(args Tuple, kwargs StringDict) (Object, error)\n```\nCall type()\n\n```go\nfunc (ty *Type) M__eq__(other Object) (Object, error)\n```\nFIXME this should be the default?\n\n```go\nfunc (ty *Type) M__ne__(other Object) (Object, error)\n```\nFIXME this should be the default?\n\n```go\nfunc (ty *Type) M__repr__() (Object, error)\n```\n\n```go\nfunc (ty *Type) M__str__() (Object, error)\n```\n\n```go\nfunc (t *Type) NativeGetAttrOrNil(name string) Object\n```\nGet an attribute from the type of a go type\n\nDoesn't call \\_\\_getattr\\_\\_ etc\n\n### Returns nil if not found {#hdr-Returns_nil_if_not_found}\n\nDoesn't look in the instance dictionary\n\nFIXME this isn't totally correct! as we are ignoring getattribute etc See \\_PyObject\\_GenericGetAttrWithDict in object.c\n\n```go\nfunc (t *Type) NewType(Name string, Doc string, New NewFunc, Init InitFunc) *Type\n```\nMake a subclass of a type\n\nFor making Go types\n\n```go\nfunc (t *Type) NewTypeFlags(Name string, Doc string, New NewFunc, Init InitFunc, Flags uint) *Type\n```\nMake a subclass of a type\n\nFor making Go types\n\n```go\nfunc (t *Type) Ready() error\n```\nReady the type for use\n\nReturns an error on problems\n\n```go\nfunc (t *Type) Type() *Type\n```\nType of this object\n\n```go\ntype Zip struct {\n\t// contains filtered or unexported fields\n}\n```\nA python Zip object\n\n```go\nfunc (z *Zip) M__iter__() (Object, error)\n```\nZip iterator\n\n```go\nfunc (z *Zip) M__next__() (Object, error)\n```\n\n```go\nfunc (z *Zip) Type() *Type\n```\nType of this object\n\n","path":"github.com/go-python/gpython/py","name":"py","synopsis":"Function objects","isRedistributable":true}
