# Functions
Abs the python Object returning an Object
Will raise TypeError if Abs can't be run on this object.
Add two python objects together returning an Object
Will raise TypeError if can't be add can't be run on these objects.
And two python objects together returning an Object
Will raise TypeError if can't be and can't be run on these objects.
AttributeName converts an Object to a string, raising a TypeError if it wasn't a String.
Checks that obj is exactly a BigInt and returns an error if not.
Checks that obj is exactly a BigInt and returns an error if not.
The actual import code.
Converts an object into bytes.
BytesNew.
Calls function fnObj with args and kwargs in a new vm (or directly if Go code)
kwargs should be nil if not required
fnObj must be a callable type such as *py.Method or *py.Function
The result is returned.
ClassMethodNew.
ComplexNew.
Convert an Object to an BigInt
Returns ok as to whether the conversion worked or not.
DebugRepr - see Repr but returns the repr or error as a string.
DeleteAttr.
DeleteAttrString.
Delitem.
Checks that obj is exactly a dictionary and returns an error if not.
Checks that obj is exactly a dictionary and returns an error if not.
DictNew.
DivMod two python objects together returning an Object
Will raise TypeError if can't be divmod can't be run on these objects.
EnumerateTypeNew.
Eq two python objects returning a boolean result
Will raise TypeError if Eq can't be run on this object.
Checks that the object passed in is a class and is an exception.
Check to see if err matches exc
exc can be a tuple
Used in except statements.
ExceptionNew.
ExceptionNewf - make a new exception with fmt parameters.
No description provided by the author
FilterTypeNew.
PyFloat_AsDouble.
Returns the float value of obj if it is a float subclass.
Returns the float value of obj if it is exactly a float.
FloatFromString turns a string into a Float.
FloatNew.
FloorDiv two python objects together returning an Object
Will raise TypeError if can't be floordiv can't be run on these objects.
Ge two python objects returning a boolean result
Will raise TypeError if Ge can't be run on this object.
GetAttrErr - returns the result or an err to be raised if not found
If not found an AttributeError will be returned.
GetAttrString - returns the result or an err to be raised if not found
If not found err will be an AttributeError.
GetInt is a high-level convenience function that converts the given value to an int.
GetItem.
GetLen is a high-level convenience function that returns the length of the given Object.
No description provided by the author
Gt two python objects returning a boolean result
Will raise TypeError if Gt can't be run on this object.
Inplace add.
Inplace and.
Inplace floordiv.
Inplace lshift.
Inplace mod.
No description provided by the author
The workings of __import__
__import__(name, globals=None, locals=None, fromlist=(), level=0)
This function is invoked by the import statement.
Inplace mul.
Index the python Object returning an Int
Will raise TypeError if Index can't be run on this object.
Index the python Object returning an int
Will raise TypeError if Index can't be run on this object
or IndexError if the Int won't fit!.
As IndexInt but if index is -ve addresses it from the end
If index is out of range throws IndexError.
Create an Int (or BigInt) from the string passed in
FIXME check this is 100% python compatible.
IntNew.
Invert the python Object returning an Object
Will raise TypeError if Invert can't be run on this object.
Inplace or.
Inplace pow.
Inplace rshift.
IsException matches the result of recover to an exception
# For use to catch a single python exception from go code
It can be an instance or the class itself.
Inplace sub.
Returns an iterator object
Call __Iter__ Returns an iterator object
If object is sequence object, create an iterator.
Create an iterator from obj and iterate the iterator until finished calling the function passed in on each object.
Inplace truediv.
Inplace xor.
Le two python objects returning a boolean result
Will raise TypeError if Le can't be run on this object.
Returns the number of items of a sequence or mapping.
ListNew.
LoadAttr gets the named attribute and attempts to store it into the given destination value (based on its type).
LoadIntsFromList extracts a list of ints contained given a py.List or py.Tuple.
LoadTuple attempts to convert each element of the given list and store into each destination value (based on its type).
Lshift two python objects together returning an Object
Will raise TypeError if can't be lshift can't be run on these objects.
Lt two python objects returning a boolean result
Will raise TypeError if Lt can't be run on this object.
Bool is called to implement truth value testing and the built-in operation bool(); should return False or True.
MakeComplex the python Object returning an Object
Will raise TypeError if MakeComplex can't be run on this object.
Coerce an object into an exception instance one way or another.
MakeFloat the python Object returning an Object
Will raise TypeError if MakeFloat can't be run on this object.
Turns a into a go int if possible.
Turns a into a go int64 if possible.
MakeInt the python Object returning an Object
Will raise TypeError if MakeInt can't be run on this object.
First calls MakeException then adds the extra details in to make it a SyntaxError.
MapType.
Mod two python objects together returning an Object
Will raise TypeError if can't be mod can't be run on these objects.
Mul two python objects together returning an Object
Will raise TypeError if can't be mul can't be run on these objects.
As NewMethod but panics on error.
Ne two python objects returning a boolean result
Will raise TypeError if Ne can't be run on this object.
Neg the python Object returning an Object
Will raise TypeError if Neg can't be run on this object.
Make a new bool - returns the canonical True and False values.
Define a new boundmethod.
Define a new CallIterator.
Define a new cell.
Make a new code object.
Make a new frame for a code object.
Make a new empty frozen set.
Make a new set with the items passed in.
Define a new function
Return a new function object associated with the code object code.
Define a new generator.
Define a new iterator.
Make a new empty list.
Make a new list from an []Object
The []Object is copied into the list.
Makes an argv into a tuple.
Make a list with n nil elements.
Make a new empty list with given capacity.
Define a new method.
No description provided by the author
Make a new empty set.
Make a new set with the items passed in.
Make a new empty set with capacity for n items.
Make a new slice object.
Make a new dictionary.
Make a new dictionary with reservation for n entries.
Make a new traceback.
Make a new type from a name
For making Go types.
Make a new type with constructors
For making Go types.
Call __next__ for the python object
# Returns the next object
err == StopIteration or subclass when finished.
Return the result of not a.
Gets the attribute attr from object or returns nil.
No description provided by the author
Return whether the object is a sequence.
Return whether the object is True or not.
No description provided by the author
Gets the repr for an object.
No description provided by the author
Or two python objects together returning an Object
Will raise TypeError if can't be or can't be run on these objects.
Parse tuple only.
ParseTupleAndKeywords.
Pos the python Object returning an Object
Will raise TypeError if Pos can't be run on this object.
Pow three python objects together returning an Object
If c != None then it won't attempt to call __rpow__
Will raise TypeError if can't be pow can't be run on these objects.
Println prints the provided strings to gpython's stdout.
RangeNew.
No description provided by the author
Calls __str__ on the object
Calls __repr__ on the object or returns a sensible default.
Returns object as a string
Calls Repr then makes sure the output is a string.
Rshift two python objects together returning an Object
Will raise TypeError if can't be rshift can't be run on these objects.
RunCode executes the given code object within the given module and returns the Module to indicate success.
RunFile resolves the given pathname, compiles as needed, executes the code in the given module, and returns the Module to indicate success.
RunSrc compiles the given python buffer and executes it within the given module and returns the Module to indicate success.
Call send for the python object.
SequenceContains returns True if obj is in seq.
Converts a sequence object v into a List.
Converts a sequence object v into a Set.
Converts a sequence object v into a Tuple.
SetAttr.
SetAttrString.
SetItem.
SetNew.
SliceNew.
SortInPlace sorts the given List in place using a stable sort.
StaticMethodNew.
Calls __str__ on the object and if not found calls __repr__.
Returns object as a string
Calls Str then makes sure the output is a string.
Escape the py.String.
StrNew.
Sub two python objects together returning an Object
Will raise TypeError if can't be sub can't be run on these objects.
Dumps a traceback to stderr.
TrueDiv two python objects together returning an Object
Will raise TypeError if can't be truediv can't be run on these objects.
TupleNew.
Calls a type method on obj
If obj isnt a *Type or the method isn't found on it returns (nil, false, nil)
Otherwise returns (object, true, err)
May raise exceptions if calling the method fails.
Calls TypeCall with 0 arguments.
Calls TypeCall with 1 argument.
Calls TypeCall with 2 arguments.
TypeDelayReady stores the list of types to initialise
Call MakeReady when all initialised.
No description provided by the author
TypeMakeReady readies all the types.
Create a new type.
Unpack the args tuple into the results
Up to the caller to set default values.
Straight port of the python code
This calls functins from _bootstrap.py which is a frozen module
Too much functionality for the moment.
Xor two python objects together returning an Object
Will raise TypeError if can't be xor can't be run on these objects.
ZipTypeNew.
# Constants
This value is found in the cell2arg array when the associated cell variable does not correspond to an argument.
No description provided by the author
do absolute imports by default.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Max static block nesting within a function.
No description provided by the author
No description provided by the author
No description provided by the author
Masks for flags above.
No description provided by the author
No description provided by the author
Compile an expression.
Compile a module.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Go integer limits.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Maximum possible Int.
Minimum possible Int.
No description provided by the author
The method will be passed the type object as the first parameter rather than an instance of the type.
The method will be loaded in place of existing definitions.
The method will be passed NULL as the first parameter rather than an instance of the type.
No description provided by the author
ShareModule signals that an embedded module is threadsafe and read-only, meaninging it could be shared across multiple py.Context instances (for efficiency).
Compile a single (interactive) statement.
No description provided by the author
Set if the type allows subclassing.
No description provided by the author
No description provided by the author
No description provided by the author
Objects support garbage collection (see objimp.h).
Objects support type attribute cache.
Set if the type object is dynamically allocated.
These flags are used to determine if a type is a subclass.
Type is abstract and cannot be instantiated.
No description provided by the author
No description provided by the author
Set if the type is 'ready' -- fully initialized.
Set while the type is being 'readied', to prevent recursive ready calls.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
Exception heirachy.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Compiles a python buffer into a py.Code object.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DefaultAuxSysPaths are secondary default search paths for module sys.
DefaultContextOpts should be the default opts created for py.NewContext.
DefaultCoreSysPaths specify default search paths for module sys This can be changed during runtime and plays nice with others using DefaultContextOpts().
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Some well known bools.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewContext is a high-level call to create a new gpython interpreter context.
And the ubiquitous.
No description provided by the author
No description provided by the author
Singleton exceptions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Set in vm/eval.go - to avoid circular import.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
A python BoundMethod object.
A python CallIterator object.
A python Cell object.
No description provided by the author
Code object
Freevars 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.
CompileOpts specifies options for high-level compilation.
CompileOut the output of high-level compilation -- e.g.
ContextOpts specifies fundamental environment and input settings for creating a new py.Context.
No description provided by the author
A python Enumerate object.
A python Enumerate iterator.
A python Exception object.
A python exception info block.
No description provided by the author
A python Filter object.
A python Frame object.
No description provided by the author
A python Function object.
A python Generator object.
A python Iterator object.
FIXME lists are mutable so this should probably be struct { Tuple } then can use the sub methods on Tuple.
A python Map object.
A python Method object.
Module is a runtime instance of a ModuleImpl bound to the py.Context that imported it.
ModuleImpl is used for modules that are ready to be imported into a py.Context.
ModuleInfo contains info and about a module and can specify flags that affect how it is imported into a py.Context.
ModuleStore is a container of Module imported into an owning py.Context.
No description provided by the author
A python Property object.
A python Range object FIXME one day support BigInts too!.
A python Range iterator.
No description provided by the author
No description provided by the author
No description provided by the author
A python Slice object.
No description provided by the author
A python Traceback object.
Store information about try blocks.
No description provided by the author
A python Zip object.
# Interfaces
Context is a gpython environment instance container, providing a high-level mechanism for multiple python interpreters to run concurrently without restriction.
object.__abs__(self).
object.__add__(self, other).
object.__and__(self, other).
Called to implement truth value testing and the built-in operation bool(); should return False or True.
Called by bytes() to compute a byte-string representation of an object.
Called when the instance is “called” as a function; if this method is defined, x(arg1, arg2, ...) is a shorthand for x.__call__(arg1, arg2, ...).
Return the ceiling of x, the smallest integer greater than or equal to x.
object.__complex__(self).
Called to implement membership test operators.
Called when the instance is about to be destroyed.
Like __setattr__() but for attribute deletion instead of assignment.
Called to delete the attribute on an instance instance of the owner class.
Called to implement deletion of self[key].
Called when dir() is called on the object.
object.__divmod__(self, other).
Enter the runtime context related to this object.
object.__eq__(self, other).
Exit the runtime context related to this object.
object.__float__(self).
Return the floor of x, the largest integer less than or equal to x.
object.__floordiv__(self, other).
Called 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.
object.__ge__(self, other).
Called to get the attribute of the owner class (class attribute access) or of an instance of that class (instance attribute access).
Called when an attribute lookup has not found the attribute in the usual places (i.e.
Called unconditionally to implement attribute accesses for instances of the class.
Called to implement evaluation of self[key].
object.__gt__(self, other).
Called by built-in function hash() and for operations on members of hashed collections including set, frozenset, and dict.
object.__iadd__(self, other).
object.__iand__(self, other).
object.__ifloordiv__(self, other).
object.__ilshift__(self, other).
object.__imod__(self, other).
object.__imul__(self, other).
object.__index__(self).
Called when the instance is created.
Return true if instance should be considered a (direct or indirect) instance of class.
object.__int__(self).
object.__invert__(self).
object.__ior__(self, other).
No description provided by the author
object.__irshift__(self, other).
object.__isub__(self, other).
This method is called when an iterator is required for a container.
object.__itruediv__(self, other).
object.__ixor__(self, other).
object.__le__(self, other).
Called to implement the built-in function len().
Called to implement operator.length_hint().
object.__lshift__(self, other).
These are the so-called “rich comparison” methods.
object.__mod__(self, other).
object.__mul__(self, other).
object.__ne__(self, other).
object.__neg__(self).
Called to create a new instance of class cls.
The next method for iterators.
object.__or__(self, other).
object.__pos__(self).
object.__pow__(self, other[, modulo]).
object.__radd__(self, other).
object.__rand__(self, other).
object.__rdivmod__(self, other).
Called by the repr() built-in function to compute the “official” string representation of an object.
Called (if present) by the reversed() built-in to implement reverse iteration.
object.__rfloordiv__(self, other).
object.__rlshift__(self, other).
object.__rmod__(self, other).
object.__rmul__(self, other).
object.__ror__(self, other).
object.__round__(self, n).
object.__rpow__(self, other).
object.__rrshift__(self, other).
object.__rshift__(self, other).
object.__rsub__(self, other).
object.__rtruediv__(self, other).
object.__rxor__(self, other).
Called to set the attribute on an instance of the owner class to a new value.
Called when an attribute assignment is attempted.
Called to implement assignment to self[key].
Called by str(object) and the built-in functions format() and print() to compute the “informal” or nicely printable string representation of an object.
object.__sub__(self, other).
Return true if subclass should be considered a (direct or indirect) subclass of class.
object.__truediv__(self, other).
Return the Real value x truncated to an Integral (usually an integer).
object.__xor__(self, other).
No description provided by the author
Interface all generators must satisfy.
Interface all iterators must satisfy.
Generator interfaces.
No description provided by the author
Optional interfaces.
No description provided by the author
No description provided by the author
A python object.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Internal method types implemented within eval.go.
No description provided by the author
No description provided by the author
Called with self and a tuple of args.
Called with one (unnamed) parameter only.
Called with self only.
Called with self, a tuple of args and a stringdic of kwargs.
No description provided by the author
String to object dictionary
Used for variables etc where the keys can only be strings.
What kind of block this is.
No description provided by the author