ft3.objects.typ module¶
Objects typing.
- class Field(origin: type, args: type[AnyTypeCo] | AnyTypeCo)¶
Bases:
GenericAlias,Generic[AnyTypeCo]Single Generic alias type.
- class string(object: object = Ellipsis, encoding: str = Ellipsis, errors: str = Ellipsis)¶
Bases:
str,Generic[StringType]Generic
strprotocol.- capitalize() string[StringType] | string[Any] | LiteralString¶
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower case.
- casefold() string[StringType] | string[Any] | LiteralString¶
Return a version of the string suitable for caseless comparisons.
- center(width: SupportsIndex, fillchar: LiteralString | str = ' ', /) string[StringType] | string[Any] | LiteralString¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
- expandtabs(tabsize: SupportsIndex = 8) string[StringType] | string[Any] | LiteralString¶
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
- format(*args, **kwargs) str¶
Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).
- format_map(mapping) str¶
Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).
- join(iterable: Iterable[LiteralString] | Iterable[string[StringType]] | str, /) LiteralString | string[StringType] | string[Any]¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- ljust(width: SupportsIndex, fillchar: LiteralString | str = ' ', /) LiteralString | string[StringType] | string[Any]¶
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
- lower() LiteralString | string[StringType] | string[Any]¶
Return a copy of the string converted to lowercase.
- lstrip(chars: LiteralString | str | None = None, /) LiteralString | string[StringType] | string[Any]¶
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
- partition(sep: LiteralString | str, /) tuple[LiteralString, LiteralString, LiteralString] | tuple[string[StringType] | string[Any], string[StringType] | string[Any], string[StringType] | string[Any]]¶
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string and two empty strings.
- removeprefix(prefix: LiteralString | str, /) LiteralString | string[StringType] | string[Any]¶
Return a str with the given prefix string removed if present.
If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.
- removesuffix(suffix: LiteralString | str, /) LiteralString | string[StringType] | string[Any]¶
Return a str with the given suffix string removed if present.
If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.
- replace(old: LiteralString | str, new: LiteralString | str, count: SupportsIndex = -1, /) LiteralString | string[StringType] | string[Any]¶
Return a copy with all occurrences of substring old replaced by new.
count Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are replaced.
- rjust(width: SupportsIndex, fillchar: LiteralString | str = ' ', /) LiteralString | string[StringType] | string[Any]¶
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
- rpartition(sep: LiteralString | str, /) tuple[LiteralString, LiteralString, LiteralString] | tuple[string[StringType] | string[Any], string[StringType] | string[Any], string[StringType] | string[Any]]¶
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings and the original string.
- rsplit(sep: LiteralString | str | None = None, maxsplit: SupportsIndex = -1) list[LiteralString] | list[string[StringType] | string[Any]]¶
Return a list of the substrings in the string, using sep as the separator string.
sep The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.
maxsplit Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the end of the string and works to the front.
- rstrip(chars: LiteralString | str | None = None, /) LiteralString | string[StringType] | string[Any]¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- split(sep: LiteralString | str | None = None, maxsplit: SupportsIndex = -1) list[LiteralString] | list[string[StringType] | string[Any]]¶
Return a list of the substrings in the string, using sep as the separator string.
sep The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.
maxsplit Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the front of the string and works to the end.
Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.
- splitlines(keepends: bool = False) list[LiteralString] | list[string[StringType] | string[Any]]¶
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and true.
- strip(chars: LiteralString | str | None = None, /) LiteralString | string[StringType] | string[Any]¶
Return a copy of the string with leading and trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- swapcase() LiteralString | string[StringType] | string[Any]¶
Convert uppercase characters to lowercase and lowercase characters to uppercase.
- title() LiteralString | string[StringType] | string[Any]¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining cased characters have lower case.
- translate(table: lib.builtins._TranslateTable, /) string[StringType] | string[lib.t.Any]¶
Replace each character in the string using the given translation table.
table Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.
The table must implement lookup/indexing via getitem, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.
- class NoneType¶
Bases:
object
- Typed¶
alias of
SupportsAnnotations
- UnionGenericAlias¶
alias of
UnionType