Class PyBytecode

All Implemented Interfaces:
Serializable, Traverseproc

public class PyBytecode extends PyBaseCode implements Traverseproc
See Also:
  • Field Details

    • defaultDebug

      public static boolean defaultDebug
    • CO_MAXBLOCKS

      public static final int CO_MAXBLOCKS
      See Also:
    • co_code

      public final byte[] co_code
    • co_consts

      public final PyObject[] co_consts
    • co_names

      public final String[] co_names
    • co_stacksize

      public final int co_stacksize
    • co_lnotab

      public final byte[] co_lnotab
  • Constructor Details

    • PyBytecode

      public PyBytecode(int argcount, int nlocals, int stacksize, int flags, String codestring, PyObject[] constants, String[] names, String[] varnames, String filename, String name, int firstlineno, String lnotab)
    • PyBytecode

      public PyBytecode(int argcount, int nlocals, int stacksize, int flags, String codestring, PyObject[] constants, String[] names, String[] varnames, String filename, String name, int firstlineno, String lnotab, String[] cellvars, String[] freevars)
  • Method Details

    • _allDebug

      public static void _allDebug(boolean setting)
    • _debug

      public PyObject _debug(int maxCount)
    • __dir__

      public PyObject __dir__()
      Description copied from class: PyObject
      Equivalent to the standard Python __dir__ method.
      Overrides:
      __dir__ in class PyObject
      Returns:
      a list of names defined by this object.
    • __setattr__

      public void __setattr__(String name, PyObject value)
      Description copied from class: PyObject
      A variant of the __setattr__ method which accepts a String as the key. This String must be interned.
      Overrides:
      __setattr__ in class PyObject
      Parameters:
      name - the name whose value will be set - must be an interned string .
      value - the value to set this name to
      See Also:
    • __delattr__

      public void __delattr__(String name)
      Description copied from class: PyObject
      A variant of the __delattr__ method which accepts a String as the key. This String must be interned. By default, this will call __delattr__(PyString name) with the appropriate args. The only reason to override this method is for performance.
      Overrides:
      __delattr__ in class PyObject
      Parameters:
      name - the name which will be removed - must be an interned string .
      See Also:
    • __findattr_ex__

      public PyObject __findattr_ex__(String name)
      Description copied from class: PyObject
      Attribute lookup hook. If the attribute is not found, null may be returned or a Py.AttributeError can be thrown, whatever is more correct, efficient and/or convenient for the implementing class. Client code should use PyObject.__getattr__(String) or PyObject.__findattr__(String). Both methods have a clear policy for failed lookups.
      Overrides:
      __findattr_ex__ in class PyObject
      Returns:
      The looked up value. May return null if the attribute is not found
    • traverse

      public int traverse(Visitproc visit, Object arg)
      Description copied from interface: Traverseproc
      Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc.visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc.visit(PyObject, Object) must not be called with a null PyObject-argument.
      Specified by:
      traverse in interface Traverseproc
    • refersDirectlyTo

      public boolean refersDirectlyTo(PyObject ob)
      Description copied from interface: Traverseproc
      Optional operation. Should only be implemented if it is more efficient than calling Traverseproc.traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.
      Specified by:
      refersDirectlyTo in interface Traverseproc