ImportString#
Mypy_boto3_builder Index / Mypy Boto3 Builder / Import Helpers / ImportString
Auto-generated documentation for mypy_boto3_builder.import_helpers.import_string module.
ImportString#
Show source in import_string.py:12
Wrapper for Python import strings.
Arguments#
master
- Master module nameparts
- Other import parts
Examples#
import_string = ImportString("my", "name")
str(import_string)
'my.name'
import_string.render()
'my.name'
import_string.parts.append('test')
import_string.render()
'my.name.test'
Signature#
ImportString.empty#
Show source in import_string.py:50
Create an empty ImportString.
Signature#
ImportString.from_str#
Show source in import_string.py:43
Create from string.
Signature#
ImportString().master_name#
Show source in import_string.py:130
Get first import string part or builtins
.
Signature#
ImportString.parent#
Show source in import_string.py:59
Get parent ImportString.
Signature#
ImportString().render#
Show source in import_string.py:121
Render to string.
Returns#
Ready to use import string.
Signature#
ImportString().startswith#
Show source in import_string.py:89
Check if import string starts with other
.
Examples#
ImportString('my', 'name').startswith(ImportString('my'))
True
ImportString('my_module', 'name').startswith(ImportString('my'))
False
ImportString('my', 'name').startswith(ImportString('my, 'name'))
True
ImportString('my', 'name').startswith(ImportString.empty())
True
Arguments#
other
- Other import string.