Documentation
¶
Overview ¶
Package future ports cpython/Python/future.c. It walks a Module AST past its docstring and collects __future__ imports into a Features bitmask plus the location of the last __future__ statement.
Index ¶
Constants ¶
const ( Division uint32 = 0x20000 AbsoluteImport uint32 = 0x40000 WithStatement uint32 = 0x80000 PrintFunction uint32 = 0x100000 UnicodeLiterals uint32 = 0x200000 BarryAsBdfl uint32 = 0x400000 GeneratorStop uint32 = 0x800000 Annotations uint32 = 0x1000000 )
CO_FUTURE_* flag bits. Numeric values match cpython/Include/cpython/code.h byte-for-byte so that a code object produced by gopy carries flags interchangeable with CPython.
CPython: Include/cpython/code.h:L135
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Features ¶
Features is the gopy equivalent of CPython's _PyFutureFeatures.
CPython: Include/internal/pycore_symtable.h _PyFutureFeatures
type SyntaxError ¶
SyntaxError carries the same shape as the Python SyntaxError that CPython raises from this module: a message plus the source range.
CPython: Python/future.c PyErr_RangedSyntaxLocationObject
func (*SyntaxError) Error ¶
func (e *SyntaxError) Error() string
Error formats the syntax error as a plain string.
CPython: Python/future.c PyErr_RangedSyntaxLocationObject message