stubber.rst.output_dict
¶
- ModuleSourceDict represents a source file with the following components
docstr
version
comment
typing
Optional: list of constants
optional: ClassSourcedicts
optional: FunctionSourcedicts
optional: individual lines of code
- ClassSourceDict represents a source file with the following components
comment
class
docstr
Optional: list of constants
__init__ : class signature
optional: FunctionSourcedicts
optional: individual lines of code
- FunctionSourceDict represents a source file with the following components
# comments - todo
optional: decorator
def - function definition
docstr
constants
body - …
optional: individual lines of code
SourceDict is the ‘base class’
Module Contents¶
Classes¶
(abstract) dict to store source components respecting parent child dependencies and proper definition order |
|
(abstract) dict to store source components respecting parent child dependencies and proper definition order |
|
(abstract) dict to store source components respecting parent child dependencies and proper definition order |
|
(abstract) dict to store source components respecting parent child dependencies and proper definition order |
- class stubber.rst.output_dict.SourceDict(base: List, indent: int = 0, body: int = 0, lf: str = '\n', name='')¶
Bases:
OrderedDict
(abstract) dict to store source components respecting parent child dependencies and proper definition order
- __add__(other: SourceDict)¶
Aallows instances of the SourceDict class to be added together using the + operator or the += operator.
- Parameters:
other (SourceDict) –
- class stubber.rst.output_dict.ModuleSourceDict(name: str, indent=0, lf: str = '\n')¶
Bases:
SourceDict
(abstract) dict to store source components respecting parent child dependencies and proper definition order
- sort()¶
make sure all classdefs are in order
- __str__()¶
sort in the correct parent-child order, then convert to string (the code)
- classes()¶
get a list of the class names in parent-child order
- class stubber.rst.output_dict.ClassSourceDict(name: str, *, docstr: List[str] | None = None, init: str = '', indent: int = 0, lf='\n')¶
Bases:
SourceDict
(abstract) dict to store source components respecting parent child dependencies and proper definition order
- class stubber.rst.output_dict.FunctionSourceDict(name: str, *, definition: List[str] | None = None, docstr: List[str] | None = None, indent: int = 0, decorators: List[str] | None = None, lf='\n', is_async: bool = False)¶
Bases:
SourceDict
(abstract) dict to store source components respecting parent child dependencies and proper definition order