File: custom_types.py
Role: Python Source Code
Path: mosheh
For every type hint and notation that goes beyond the traditional, there is a custom type here created.
The idea of this types is to keep everything logical and short, with proper types and in-code description. This is a way to turn Python into a "typed" lang, kinda.
The Statement
, ImportType
, FunctionType
and FileRole
classes are enums with a
really useful function: to standardize the possible types of their own types (for
example, a function strictly assumes only 4 different types, and exactly one of
them).
The other ones are typing.TypeAlias
, simpler but also fuctional.
Imports
import Enum
Path: enum
Category: Native
SNIPPET
Python | |
---|---|
import auto
Path: enum
Category: Native
SNIPPET
Python | |
---|---|
import TypeAlias
Path: typing
Category: Native
SNIPPET
Python | |
---|---|
Consts
NO CONSTANT DEFINED HERE
Classes
class Statement
Parents: Enum
Decorators: None
Kwargs: None
Enum-like class to enumerate in-code the dealed statements.
SNIPPET
class ImportType
Parents: Enum
Decorators: None
Kwargs: None
Enum-like class to enumerate in-code the import types.
SNIPPET
class FunctionType
Parents: Enum
Decorators: None
Kwargs: None
Enum-like class to enumerate in-code the function types.
SNIPPET
class FileRole
Parents: Enum
Decorators: None
Kwargs: None
Enum-like class to enumerate in-code the files investigated.
SNIPPET
Functions
NO FUNCTION DEFINED HERE
Assertions
NO ASSERT DEFINED HERE