THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class documentation
class _Annotations(ast.NodeTransformer): (source)
Constructor: _Annotations(module, imports, contract, aliases)
Use qualified imports so inherited methods cannot shadow each other's types.
| Method | __init__ |
Initialize the context for copying a service annotation into a facade. |
| Method | _attribute |
Resolve a dotted attribute and register any needed submodule import. |
| Method | _expression |
Transform an expression while preserving its syntax category. |
| Method | _name |
Resolve an annotation identifier in the current type scope. |
| Method | _subscript |
Resolve the arguments of a parameterized type. |
| Method | annotation |
Resolve a quoted forward reference or an ordinary annotation. |
| Method | bind |
Resolve nested declaration names against their declaring class. |
| Method | visit |
Rewrite annotation references for use outside the service module. |
| Instance Variable | aliases |
Generated import aliases and the qualified names they represent. |
| Instance Variable | bindings |
Type arguments supplied by a specialization of the declaring class. |
| Instance Variable | class |
Qualified references to nested classes and type aliases. |
| Instance Variable | contract |
Qualified service class substituted for receiver-dependent types. |
| Instance Variable | imports |
Import statements accumulated for the generated stub. |
| Instance Variable | module |
Module in which the original annotation was written. |
| Instance Variable | parameters |
Type parameters bound by the current method. |
| Instance Variable | receiver |
Type parameter that represents the service receiver, when present. |
def __init__(self, module:
_Module, imports: set[ str], contract: str, aliases: dict[ str, str]):
(source)
¶
Initialize the context for copying a service annotation into a facade.
| Parameters | |
module:_Module | Source module of the service declaration. |
imports:set[ | Import statements shared by the generated declarations. |
contract:str | Qualified service class used for receiver-dependent return types. |
aliases:dict[ | Existing import aliases shared by inherited declarations. |
| Returns | |
None | Prepare name resolution for the current declaration. |
Resolve a dotted attribute and register any needed submodule import.
| Parameters | |
node:ast.Attribute | Attribute reference from a service annotation. |
| Returns | |
ast.expr | Expression that names the same attribute in the generated stub. |
Transform an expression while preserving its syntax category.
| Parameters | |
node:ast.expr | Expression to visit during annotation resolution. |
| Returns | |
ast.expr | Transformed annotation or metadata expression. |
Resolve an annotation identifier in the current type scope.
| Parameters | |
node:ast.Name | Unqualified name from a service annotation. |
| Returns | |
ast.expr | Reference to a built-in, type parameter or importable service type. |
Resolve the arguments of a parameterized type.
| Parameters | |
node:ast.Subscript | Type expression with arguments inside square brackets. |
| Returns | |
ast.expr | Qualified type expression preserving literal values and metadata. |
Resolve nested declaration names against their declaring class.
| Parameters | |
definition:ast.ClassDef | Class whose nested types may appear in method signatures. |
| Returns | |
None | Record the qualified names of its nested classes and type aliases. |