_importstmt module

class pyflyby._importstmt.ImportFormatParams
align_future = False

Whether ‘from __future__ import …’ statements should be aligned with others. If False, uses a single space after the ‘from’ and ‘import’ keywords.

align_imports = True

Whether and how to align ‘from modulename import aliases…’. If True, then the ‘import’ keywords will be aligned within a block. If an integer, then the ‘import’ keyword will always be at that column. They will be wrapped if necessary.

from_spaces = 1

The number of spaces after the ‘from’ keyword. (Must be at least 1.)

separate_from_imports = True

Whether all ‘from … import …’ in an import block should come after ‘import …’ statements. separate_from_imports = False works well with from_spaces = 3. (‘from __future__ import …’ always comes first.)

class pyflyby._importstmt.ImportSplit(module_name, member_name, import_as)

Representation of a single import at the token level:

from [...]<module_name> import <member_name> as <import_as>
If <module_name> is None, then there is no “from” clause; instead just::

import <member_name> as <import_as>

_asdict()

Return a new OrderedDict which maps field names to their values.

_field_defaults = {}
_fields = ('module_name', 'member_name', 'import_as')
_fields_defaults = {}
classmethod _make(iterable)

Make a new ImportSplit object from a sequence or iterable

_replace(**kwds)

Return a new ImportSplit object replacing specified fields with new values

property import_as

Alias for field number 2

property member_name

Alias for field number 1

property module_name

Alias for field number 0