basics
module fastcore.basics in fastcore
Classes
builtins.dict(builtins.object)
AttrDict
builtins.float(builtins.object)
Float(builtins.float, ShowPrint)
builtins.int(builtins.object)
Int(builtins.int, ShowPrint)
builtins.object
GetAttr
GetAttrBase
Inf
ShowPrint
Float(builtins.float, ShowPrint)
Int(builtins.int, ShowPrint)
Str(builtins.str, ShowPrint)
Stateful
bind
ignore_exceptions
builtins.str(builtins.object)
PrettyString
Str(builtins.str, ShowPrint)
StrEnum(builtins.str, ImportEnum)
builtins.tuple(builtins.object)
fastuple
enum.Enum(builtins.object)
ImportEnum
StrEnum(builtins.str, ImportEnum)
AttrDict
class AttrDict(builtins.dict)
| `dict` subclass that also provides access to keys as attrs
|
| Method resolution order:
| AttrDict
| builtins.dict
| builtins.object
|
| Methods defined here:
|
|
AttrDict.__dir__
|
| __dir__(self)
| Default dir() implementation.
|
|
AttrDict.__getattr__
|
| __getattr__(self, k)
|
|
AttrDict.__setattr__
|
| __setattr__(self, k, v)
| Implement setattr(self, name, value).
|
|
AttrDict.copy
|
| copy(self)
| D.copy() -> a shallow copy of D
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.dict:
|
|
dict.__contains__
|
| __contains__(self, key, /)
| True if the dictionary has the specified key, else False.
|
|
dict.__delitem__
|
| __delitem__(self, key, /)
| Delete self[key].
|
|
dict.__eq__
|
| __eq__(self, value, /)
| Return self==value.
|
|
dict.__ge__
|
| __ge__(self, value, /)
| Return self>=value.
|
|
dict.__getattribute__
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
|
dict.__getitem__
|
| __getitem__(...)
| x.__getitem__(y) <==> x[y]
|
|
dict.__gt__
|
| __gt__(self, value, /)
| Return self>value.
|
|
dict.__init__
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
|
dict.__ior__
|
| __ior__(self, value, /)
| Return self|=value.
|
|
dict.__iter__
|
| __iter__(self, /)
| Implement iter(self).
|
|
dict.__le__
|
| __le__(self, value, /)
| Return self<=value.
|
|
dict.__len__
|
| __len__(self, /)
| Return len(self).
|
|
dict.__lt__
|
| __lt__(self, value, /)
| Return self<value.
|
|
dict.__ne__
|
| __ne__(self, value, /)
| Return self!=value.
|
|
dict.__or__
|
| __or__(self, value, /)
| Return self|value.
|
|
dict.__repr__
|
| __repr__(self, /)
| Return repr(self).
|
|
dict.__reversed__
|
| __reversed__(self, /)
| Return a reverse iterator over the dict keys.
|
|
dict.__ror__
|
| __ror__(self, value, /)
| Return value|self.
|
|
dict.__setitem__
|
| __setitem__(self, key, value, /)
| Set self[key] to value.
|
|
dict.__sizeof__
|
| __sizeof__(...)
| D.__sizeof__() -> size of D in memory, in bytes
|
|
dict.clear
|
| clear(...)
| D.clear() -> None. Remove all items from D.
|
|
dict.get
|
| get(self, key, default=None, /)
| Return the value for key if key is in the dictionary, else default.
|
|
dict.items
|
| items(...)
| D.items() -> a set-like object providing a view on D's items
|
|
dict.keys
|
| keys(...)
| D.keys() -> a set-like object providing a view on D's keys
|
|
dict.pop
|
| pop(...)
| D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
|
| If key is not found, default is returned if given, otherwise KeyError is raised
|
|
dict.popitem
|
| popitem(self, /)
| Remove and return a (key, value) pair as a 2-tuple.
|
| Pairs are returned in LIFO (last-in, first-out) order.
| Raises KeyError if the dict is empty.
|
|
dict.setdefault
|
| setdefault(self, key, default=None, /)
| Insert key with a value of default if key is not in the dictionary.
|
| Return the value for key if key is in the dictionary, else default.
|
|
dict.update
|
| update(...)
| D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
| If E is present and has a .keys() method, then does: for k in E: D[k] = E[k]
| If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v
| In either case, this is followed by: for k in F: D[k] = F[k]
|
|
dict.values
|
| values(...)
| D.values() -> an object providing a view on D's values
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.dict:
|
|
AttrDict.__class_getitem__
|
| __class_getitem__(...) from builtins.type
| See PEP 585
|
|
AttrDict.fromkeys
|
| fromkeys(iterable, value=None, /) from builtins.type
| Create a new dictionary with keys from iterable and values set to value.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.dict:
|
|
dict.__new__
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from builtins.dict:
|
| __hash__ = None
Float
class Float(builtins.float, ShowPrint)
| Float(x=0, /)
|
| An extensible `float`
|
| Method resolution order:
| Float
| builtins.float
| ShowPrint
| builtins.object
|
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.float:
|
|
float.__abs__
|
| __abs__(self, /)
| abs(self)
|
|
float.__add__
|
| __add__(self, value, /)
| Return self+value.
|
|
float.__bool__
|
| __bool__(self, /)
| True if self else False
|
|
float.__ceil__
|
| __ceil__(self, /)
| Return the ceiling as an Integral.
|
|
float.__divmod__
|
| __divmod__(self, value, /)
| Return divmod(self, value).
|
|
float.__eq__
|
| __eq__(self, value, /)
| Return self==value.
|
|
float.__float__
|
| __float__(self, /)
| float(self)
|
|
float.__floor__
|
| __floor__(self, /)
| Return the floor as an Integral.
|
|
float.__floordiv__
|
| __floordiv__(self, value, /)
| Return self//value.
|
|
float.__format__
|
| __format__(self, format_spec, /)
| Formats the float according to format_spec.
|
|
float.__ge__
|
| __ge__(self, value, /)
| Return self>=value.
|
|
float.__getattribute__
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
|
float.__getnewargs__
|
| __getnewargs__(self, /)
|
|
float.__gt__
|
| __gt__(self, value, /)
| Return self>value.
|
|
float.__hash__
|
| __hash__(self, /)
| Return hash(self).
|
|
float.__int__
|
| __int__(self, /)
| int(self)
|
|
float.__le__
|
| __le__(self, value, /)
| Return self<=value.
|
|
float.__lt__
|
| __lt__(self, value, /)
| Return self<value.
|
|
float.__mod__
|
| __mod__(self, value, /)
| Return self%value.
|
|
float.__mul__
|
| __mul__(self, value, /)
| Return self*value.
|
|
float.__ne__
|
| __ne__(self, value, /)
| Return self!=value.
|
|
float.__neg__
|
| __neg__(self, /)
| -self
|
|
float.__pos__
|
| __pos__(self, /)
| +self
|
|
float.__pow__
|
| __pow__(self, value, mod=None, /)
| Return pow(self, value, mod).
|
|
float.__radd__
|
| __radd__(self, value, /)
| Return value+self.
|
|
float.__rdivmod__
|
| __rdivmod__(self, value, /)
| Return divmod(value, self).
|
|
float.__repr__
|
| __repr__(self, /)
| Return repr(self).
|
|
float.__rfloordiv__
|
| __rfloordiv__(self, value, /)
| Return value//self.
|
|
float.__rmod__
|
| __rmod__(self, value, /)
| Return value%self.
|
|
float.__rmul__
|
| __rmul__(self, value, /)
| Return value*self.
|
|
float.__round__
|
| __round__(self, ndigits=None, /)
| Return the Integral closest to x, rounding half toward even.
|
| When an argument is passed, work like built-in round(x, ndigits).
|
|
float.__rpow__
|
| __rpow__(self, value, mod=None, /)
| Return pow(value, self, mod).
|
|
float.__rsub__
|
| __rsub__(self, value, /)
| Return value-self.
|
|
float.__rtruediv__
|
| __rtruediv__(self, value, /)
| Return value/self.
|
|
float.__sub__
|
| __sub__(self, value, /)
| Return self-value.
|
|
float.__truediv__
|
| __truediv__(self, value, /)
| Return self/value.
|
|
float.__trunc__
|
| __trunc__(self, /)
| Return the Integral closest to x between 0 and x.
|
|
float.as_integer_ratio
|
| as_integer_ratio(self, /)
| Return integer ratio.
|
| Return a pair of integers, whose ratio is exactly equal to the original float
| and with a positive denominator.
|
| Raise OverflowError on infinities and a ValueError on NaNs.
|
| >>> (10.0).as_integer_ratio()
| (10, 1)
| >>> (0.0).as_integer_ratio()
| (0, 1)
| >>> (-.25).as_integer_ratio()
| (-1, 4)
|
|
float.conjugate
|
| conjugate(self, /)
| Return self, the complex conjugate of any float.
|
|
float.hex
|
| hex(self, /)
| Return a hexadecimal representation of a floating-point number.
|
| >>> (-0.1).hex()
| '-0x1.999999999999ap-4'
| >>> 3.14159.hex()
| '0x1.921f9f01b866ep+1'
|
|
float.is_integer
|
| is_integer(self, /)
| Return True if the float is an integer.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.float:
|
|
Float.__getformat__
|
| __getformat__(typestr, /) from builtins.type
| You probably don't want to use this function.
|
| typestr
| Must be 'double' or 'float'.
|
| It exists mainly to be used in Python's test suite.
|
| This function returns whichever of 'unknown', 'IEEE, big-endian' or 'IEEE,
| little-endian' best describes the format of floating point numbers used by the
| C type named by typestr.
|
|
Float.__setformat__
|
| __setformat__(typestr, fmt, /) from builtins.type
| You probably don't want to use this function.
|
| typestr
| Must be 'double' or 'float'.
| fmt
| Must be one of 'unknown', 'IEEE, big-endian' or 'IEEE, little-endian',
| and in addition can only be one of the latter two if it appears to
| match the underlying C reality.
|
| It exists mainly to be used in Python's test suite.
|
| Override the automatic determination of C-level floating point type.
| This affects how floats are converted to and from binary strings.
|
|
Float.fromhex
|
| fromhex(string, /) from builtins.type
| Create a floating-point number from a hexadecimal string.
|
| >>> float.fromhex('0x1.ffffp10')
| 2047.984375
| >>> float.fromhex('-0x1p-1074')
| -5e-324
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.float:
|
|
float.__new__
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.float:
|
| imag
| the imaginary part of a complex number
|
| real
| the real part of a complex number
|
| ----------------------------------------------------------------------
| Methods inherited from ShowPrint:
|
|
ShowPrint.show
|
| show(self, *args, **kwargs)
GetAttr
class GetAttr(builtins.object)
| Inherit from this to have all attr accesses in `self._xtra` passed down to `self.default`
|
| Methods defined here:
|
|
GetAttr.__dir__
|
| __dir__(self)
| Default dir() implementation.
|
|
GetAttr.__getattr__
|
| __getattr__(self, k)
|
|
GetAttr.__setstate__
|
| __setstate__(self, data)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
GetAttrBase
class GetAttrBase(builtins.object)
| Basic delegation of `__getattr__` and `__dir__`
|
| Methods defined here:
|
|
GetAttrBase.__dir__
|
| __dir__(self)
| Default dir() implementation.
|
|
GetAttrBase.__getattr__
|
| __getattr__(self, k)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
ImportEnum
class ImportEnum(enum.Enum)
| ImportEnum(value, names=None, *, module=None, qualname=None, type=None, start=1)
|
| An `Enum` that can have its values imported
|
| Method resolution order:
| ImportEnum
| enum.Enum
| builtins.object
|
| Data descriptors inherited from enum.Enum:
|
| name
| The name of the Enum member.
|
| value
| The value of the Enum member.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from enum.EnumMeta:
|
| __members__
| Returns a mapping of member name->value.
|
| This mapping lists all enum members, including aliases. Note that this
| is a read-only view of the internal mapping.
Inf
class Inf(builtins.object)
| Infinite lists
|
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
Int
class Int(builtins.int, ShowPrint)
| An extensible `int`
|
| Method resolution order:
| Int
| builtins.int
| ShowPrint
| builtins.object
|
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.int:
|
|
int.__abs__
|
| __abs__(self, /)
| abs(self)
|
|
int.__add__
|
| __add__(self, value, /)
| Return self+value.
|
|
int.__and__
|
| __and__(self, value, /)
| Return self&value.
|
|
int.__bool__
|
| __bool__(self, /)
| True if self else False
|
|
int.__ceil__
|
| __ceil__(...)
| Ceiling of an Integral returns itself.
|
|
int.__divmod__
|
| __divmod__(self, value, /)
| Return divmod(self, value).
|
|
int.__eq__
|
| __eq__(self, value, /)
| Return self==value.
|
|
int.__float__
|
| __float__(self, /)
| float(self)
|
|
int.__floor__
|
| __floor__(...)
| Flooring an Integral returns itself.
|
|
int.__floordiv__
|
| __floordiv__(self, value, /)
| Return self//value.
|
|
int.__format__
|
| __format__(self, format_spec, /)
| Default object formatter.
|
|
int.__ge__
|
| __ge__(self, value, /)
| Return self>=value.
|
|
int.__getattribute__
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
|
int.__getnewargs__
|
| __getnewargs__(self, /)
|
|
int.__gt__
|
| __gt__(self, value, /)
| Return self>value.
|
|
int.__hash__
|
| __hash__(self, /)
| Return hash(self).
|
|
int.__index__
|
| __index__(self, /)
| Return self converted to an integer, if self is suitable for use as an index into a list.
|
|
int.__int__
|
| __int__(self, /)
| int(self)
|
|
int.__invert__
|
| __invert__(self, /)
| ~self
|
|
int.__le__
|
| __le__(self, value, /)
| Return self<=value.
|
|
int.__lshift__
|
| __lshift__(self, value, /)
| Return self<<value.
|
|
int.__lt__
|
| __lt__(self, value, /)
| Return self<value.
|
|
int.__mod__
|
| __mod__(self, value, /)
| Return self%value.
|
|
int.__mul__
|
| __mul__(self, value, /)
| Return self*value.
|
|
int.__ne__
|
| __ne__(self, value, /)
| Return self!=value.
|
|
int.__neg__
|
| __neg__(self, /)
| -self
|
|
int.__or__
|
| __or__(self, value, /)
| Return self|value.
|
|
int.__pos__
|
| __pos__(self, /)
| +self
|
|
int.__pow__
|
| __pow__(self, value, mod=None, /)
| Return pow(self, value, mod).
|
|
int.__radd__
|
| __radd__(self, value, /)
| Return value+self.
|
|
int.__rand__
|
| __rand__(self, value, /)
| Return value&self.
|
|
int.__rdivmod__
|
| __rdivmod__(self, value, /)
| Return divmod(value, self).
|
|
int.__repr__
|
| __repr__(self, /)
| Return repr(self).
|
|
int.__rfloordiv__
|
| __rfloordiv__(self, value, /)
| Return value//self.
|
|
int.__rlshift__
|
| __rlshift__(self, value, /)
| Return value<<self.
|
|
int.__rmod__
|
| __rmod__(self, value, /)
| Return value%self.
|
|
int.__rmul__
|
| __rmul__(self, value, /)
| Return value*self.
|
|
int.__ror__
|
| __ror__(self, value, /)
| Return value|self.
|
|
int.__round__
|
| __round__(...)
| Rounding an Integral returns itself.
| Rounding with an ndigits argument also returns an integer.
|
|
int.__rpow__
|
| __rpow__(self, value, mod=None, /)
| Return pow(value, self, mod).
|
|
int.__rrshift__
|
| __rrshift__(self, value, /)
| Return value>>self.
|
|
int.__rshift__
|
| __rshift__(self, value, /)
| Return self>>value.
|
|
int.__rsub__
|
| __rsub__(self, value, /)
| Return value-self.
|
|
int.__rtruediv__
|
| __rtruediv__(self, value, /)
| Return value/self.
|
|
int.__rxor__
|
| __rxor__(self, value, /)
| Return value^self.
|
|
int.__sizeof__
|
| __sizeof__(self, /)
| Returns size in memory, in bytes.
|
|
int.__sub__
|
| __sub__(self, value, /)
| Return self-value.
|
|
int.__truediv__
|
| __truediv__(self, value, /)
| Return self/value.
|
|
int.__trunc__
|
| __trunc__(...)
| Truncating an Integral returns itself.
|
|
int.__xor__
|
| __xor__(self, value, /)
| Return self^value.
|
|
int.as_integer_ratio
|
| as_integer_ratio(self, /)
| Return integer ratio.
|
| Return a pair of integers, whose ratio is exactly equal to the original int
| and with a positive denominator.
|
| >>> (10).as_integer_ratio()
| (10, 1)
| >>> (-10).as_integer_ratio()
| (-10, 1)
| >>> (0).as_integer_ratio()
| (0, 1)
|
|
int.bit_length
|
| bit_length(self, /)
| Number of bits necessary to represent self in binary.
|
| >>> bin(37)
| '0b100101'
| >>> (37).bit_length()
| 6
|
|
int.conjugate
|
| conjugate(...)
| Returns self, the complex conjugate of any int.
|
|
int.to_bytes
|
| to_bytes(self, /, length, byteorder, *, signed=False)
| Return an array of bytes representing an integer.
|
| length
| Length of bytes object to use. An OverflowError is raised if the
| integer is not representable with the given number of bytes.
| byteorder
| The byte order used to represent the integer. If byteorder is 'big',
| the most significant byte is at the beginning of the byte array. If
| byteorder is 'little', the most significant byte is at the end of the
| byte array. To request the native byte order of the host system, use
| `sys.byteorder' as the byte order value.
| signed
| Determines whether two's complement is used to represent the integer.
| If signed is False and a negative integer is given, an OverflowError
| is raised.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.int:
|
|
Int.from_bytes
|
| from_bytes(bytes, byteorder, *, signed=False) from builtins.type
| Return the integer represented by the given array of bytes.
|
| bytes
| Holds the array of bytes to convert. The argument must either
| support the buffer protocol or be an iterable object producing bytes.
| Bytes and bytearray are examples of built-in objects that support the
| buffer protocol.
| byteorder
| The byte order used to represent the integer. If byteorder is 'big',
| the most significant byte is at the beginning of the byte array. If
| byteorder is 'little', the most significant byte is at the end of the
| byte array. To request the native byte order of the host system, use
| `sys.byteorder' as the byte order value.
| signed
| Indicates whether two's complement is used to represent the integer.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.int:
|
|
int.__new__
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.int:
|
| denominator
| the denominator of a rational number in lowest terms
|
| imag
| the imaginary part of a complex number
|
| numerator
| the numerator of a rational number in lowest terms
|
| real
| the real part of a complex number
|
| ----------------------------------------------------------------------
| Methods inherited from ShowPrint:
|
|
ShowPrint.show
|
| show(self, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ShowPrint:
|
| __weakref__
| list of weak references to the object (if defined)
PrettyString
class PrettyString(builtins.str)
| Little hack to get strings to show properly in Jupyter.
|
| Method resolution order:
| PrettyString
| builtins.str
| builtins.object
|
| Methods defined here:
|
|
PrettyString.__repr__
|
| __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.str:
|
|
str.__add__
|
| __add__(self, value, /)
| Return self+value.
|
|
str.__contains__
|
| __contains__(self, key, /)
| Return key in self.
|
|
str.__eq__
|
| __eq__(self, value, /)
| Return self==value.
|
|
str.__format__
|
| __format__(self, format_spec, /)
| Return a formatted version of the string as described by format_spec.
|
|
str.__ge__
|
| __ge__(self, value, /)
| Return self>=value.
|
|
str.__getattribute__
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
|
str.__getitem__
|
| __getitem__(self, key, /)
| Return self[key].
|
|
str.__getnewargs__
|
| __getnewargs__(...)
|
|
str.__gt__
|
| __gt__(self, value, /)
| Return self>value.
|
|
str.__hash__
|
| __hash__(self, /)
| Return hash(self).
|
|
str.__iter__
|
| __iter__(self, /)
| Implement iter(self).
|
|
str.__le__
|
| __le__(self, value, /)
| Return self<=value.
|
|
str.__len__
|
| __len__(self, /)
| Return len(self).
|
|
str.__lt__
|
| __lt__(self, value, /)
| Return self<value.
|
|
str.__mod__
|
| __mod__(self, value, /)
| Return self%value.
|
|
str.__mul__
|
| __mul__(self, value, /)
| Return self*value.
|
|
str.__ne__
|
| __ne__(self, value, /)
| Return self!=value.
|
|
str.__rmod__
|
| __rmod__(self, value, /)
| Return value%self.
|
|
str.__rmul__
|
| __rmul__(self, value, /)
| Return value*self.
|
|
str.__sizeof__
|
| __sizeof__(self, /)
| Return the size of the string in memory, in bytes.
|
|
str.__str__
|
| __str__(self, /)
| Return str(self).
|
|
str.capitalize
|
| capitalize(self, /)
| Return a capitalized version of the string.
|
| More specifically, make the first character have upper case and the rest lower
| case.
|
|
str.casefold
|
| casefold(self, /)
| Return a version of the string suitable for caseless comparisons.
|
|
str.center
|
| center(self, width, fillchar=' ', /)
| Return a centered string of length width.
|
| Padding is done using the specified fill character (default is a space).
|
|
str.count
|
| count(...)
| S.count(sub[, start[, end]]) -> int
|
| Return the number of non-overlapping occurrences of substring sub in
| string S[start:end]. Optional arguments start and end are
| interpreted as in slice notation.
|
|
str.encode
|
| encode(self, /, encoding='utf-8', errors='strict')
| Encode the string using the codec registered for encoding.
|
| encoding
| The encoding in which to encode the string.
| errors
| The error handling scheme to use for encoding errors.
| The default is 'strict' meaning that encoding errors raise a
| UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
| 'xmlcharrefreplace' as well as any other name registered with
| codecs.register_error that can handle UnicodeEncodeErrors.
|
|
str.endswith
|
| endswith(...)
| S.endswith(suffix[, start[, end]]) -> bool
|
| Return True if S ends with the specified suffix, False otherwise.
| With optional start, test S beginning at that position.
| With optional end, stop comparing S at that position.
| suffix can also be a tuple of strings to try.
|
|
str.expandtabs
|
| expandtabs(self, /, tabsize=8)
| Return a copy where all tab characters are expanded using spaces.
|
| If tabsize is not given, a tab size of 8 characters is assumed.
|
|
str.find
|
| find(...)
| S.find(sub[, start[, end]]) -> int
|
| Return the lowest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Return -1 on failure.
|
|
str.format
|
| format(...)
| S.format(*args, **kwargs) -> str
|
| Return a formatted version of S, using substitutions from args and kwargs.
| The substitutions are identified by braces ('{' and '}').
|
|
str.format_map
|
| format_map(...)
| S.format_map(mapping) -> str
|
| Return a formatted version of S, using substitutions from mapping.
| The substitutions are identified by braces ('{' and '}').
|
|
str.index
|
| index(...)
| S.index(sub[, start[, end]]) -> int
|
| Return the lowest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Raises ValueError when the substring is not found.
|
|
str.isalnum
|
| isalnum(self, /)
| Return True if the string is an alpha-numeric string, False otherwise.
|
| A string is alpha-numeric if all characters in the string are alpha-numeric and
| there is at least one character in the string.
|
|
str.isalpha
|
| isalpha(self, /)
| Return True if the string is an alphabetic string, False otherwise.
|
| A string is alphabetic if all characters in the string are alphabetic and there
| is at least one character in the string.
|
|
str.isascii
|
| isascii(self, /)
| Return True if all characters in the string are ASCII, False otherwise.
|
| ASCII characters have code points in the range U+0000-U+007F.
| Empty string is ASCII too.
|
|
str.isdecimal
|
| isdecimal(self, /)
| Return True if the string is a decimal string, False otherwise.
|
| A string is a decimal string if all characters in the string are decimal and
| there is at least one character in the string.
|
|
str.isdigit
|
| isdigit(self, /)
| Return True if the string is a digit string, False otherwise.
|
| A string is a digit string if all characters in the string are digits and there
| is at least one character in the string.
|
|
str.isidentifier
|
| isidentifier(self, /)
| Return True if the string is a valid Python identifier, False otherwise.
|
| Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
| such as "def" or "class".
|
|
str.islower
|
| islower(self, /)
| Return True if the string is a lowercase string, False otherwise.
|
| A string is lowercase if all cased characters in the string are lowercase and
| there is at least one cased character in the string.
|
|
str.isnumeric
|
| isnumeric(self, /)
| Return True if the string is a numeric string, False otherwise.
|
| A string is numeric if all characters in the string are numeric and there is at
| least one character in the string.
|
|
str.isprintable
|
| isprintable(self, /)
| Return True if the string is printable, False otherwise.
|
| A string is printable if all of its characters are considered printable in
| repr() or if it is empty.
|
|
str.isspace
|
| isspace(self, /)
| Return True if the string is a whitespace string, False otherwise.
|
| A string is whitespace if all characters in the string are whitespace and there
| is at least one character in the string.
|
|
str.istitle
|
| istitle(self, /)
| Return True if the string is a title-cased string, False otherwise.
|
| In a title-cased string, upper- and title-case characters may only
| follow uncased characters and lowercase characters only cased ones.
|
|
str.isupper
|
| isupper(self, /)
| Return True if the string is an uppercase string, False otherwise.
|
| A string is uppercase if all cased characters in the string are uppercase and
| there is at least one cased character in the string.
|
|
str.join
|
| join(self, iterable, /)
| 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'
|
|
str.ljust
|
| ljust(self, width, fillchar=' ', /)
| Return a left-justified string of length width.
|
| Padding is done using the specified fill character (default is a space).
|
|
str.lower
|
| lower(self, /)
| Return a copy of the string converted to lowercase.
|
|
str.lstrip
|
| lstrip(self, chars=None, /)
| Return a copy of the string with leading whitespace removed.
|
| If chars is given and not None, remove characters in chars instead.
|
|
str.partition
|
| partition(self, sep, /)
| 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.
|
|
str.removeprefix
|
| removeprefix(self, prefix, /)
| 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.
|
|
str.removesuffix
|
| removesuffix(self, suffix, /)
| 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.
|
|
str.replace
|
| replace(self, old, new, count=-1, /)
| 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.
|
|
str.rfind
|
| rfind(...)
| S.rfind(sub[, start[, end]]) -> int
|
| Return the highest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Return -1 on failure.
|
|
str.rindex
|
| rindex(...)
| S.rindex(sub[, start[, end]]) -> int
|
| Return the highest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Raises ValueError when the substring is not found.
|
|
str.rjust
|
| rjust(self, width, fillchar=' ', /)
| Return a right-justified string of length width.
|
| Padding is done using the specified fill character (default is a space).
|
|
str.rpartition
|
| rpartition(self, sep, /)
| 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.
|
|
str.rsplit
|
| rsplit(self, /, sep=None, maxsplit=-1)
| Return a list of the words in the string, using sep as the delimiter string.
|
| sep
| The delimiter according which to split the string.
| None (the default value) means split according to any whitespace,
| and discard empty strings from the result.
| maxsplit
| Maximum number of splits to do.
| -1 (the default value) means no limit.
|
| Splits are done starting at the end of the string and working to the front.
|
|
str.rstrip
|
| rstrip(self, chars=None, /)
| Return a copy of the string with trailing whitespace removed.
|
| If chars is given and not None, remove characters in chars instead.
|
|
str.split
|
| split(self, /, sep=None, maxsplit=-1)
| Return a list of the words in the string, using sep as the delimiter string.
|
| sep
| The delimiter according which to split the string.
| None (the default value) means split according to any whitespace,
| and discard empty strings from the result.
| maxsplit
| Maximum number of splits to do.
| -1 (the default value) means no limit.
|
|
str.splitlines
|
| splitlines(self, /, keepends=False)
| 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.
|
|
str.startswith
|
| startswith(...)
| S.startswith(prefix[, start[, end]]) -> bool
|
| Return True if S starts with the specified prefix, False otherwise.
| With optional start, test S beginning at that position.
| With optional end, stop comparing S at that position.
| prefix can also be a tuple of strings to try.
|
|
str.strip
|
| strip(self, chars=None, /)
| Return a copy of the string with leading and trailing whitespace removed.
|
| If chars is given and not None, remove characters in chars instead.
|
|
str.swapcase
|
| swapcase(self, /)
| Convert uppercase characters to lowercase and lowercase characters to uppercase.
|
|
str.title
|
| title(self, /)
| 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.
|
|
str.translate
|
| translate(self, table, /)
| 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.
|
|
str.upper
|
| upper(self, /)
| Return a copy of the string converted to uppercase.
|
|
str.zfill
|
| zfill(self, width, /)
| Pad a numeric string with zeros on the left, to fill a field of the given width.
|
| The string is never truncated.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.str:
|
|
str.__new__
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
|
str.maketrans
|
| maketrans(...)
| Return a translation table usable for str.translate().
|
| If there is only one argument, it must be a dictionary mapping Unicode
| ordinals (integers) or characters to Unicode ordinals, strings or None.
| Character keys will be then converted to ordinals.
| If there are two arguments, they must be strings of equal length, and
| in the resulting dictionary, each character in x will be mapped to the
| character at the same position in y. If there is a third argument, it
| must be a string, whose characters will be mapped to None in the result.
ShowPrint
class ShowPrint(builtins.object)
| Base class that prints for `show`
|
| Methods defined here:
|
|
ShowPrint.show
|
| show(self, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
Stateful
class Stateful(builtins.object)
| Stateful(*args, **kwargs)
|
| A base class/mixin for objects that should not serialize all their state
|
| Methods defined here:
|
|
Stateful.__getstate__
|
| __getstate__(self)
|
|
Stateful.__init__
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
|
Stateful.__setstate__
|
| __setstate__(self, state)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
Str
class Str(builtins.str, ShowPrint)
| An extensible `str`
|
| Method resolution order:
| Str
| builtins.str
| ShowPrint
| builtins.object
|
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.str:
|
|
str.__add__
|
| __add__(self, value, /)
| Return self+value.
|
|
str.__contains__
|
| __contains__(self, key, /)
| Return key in self.
|
|
str.__eq__
|
| __eq__(self, value, /)
| Return self==value.
|
|
str.__format__
|
| __format__(self, format_spec, /)
| Return a formatted version of the string as described by format_spec.
|
|
str.__ge__
|
| __ge__(self, value, /)
| Return self>=value.
|
|
str.__getattribute__
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
|
str.__getitem__
|
| __getitem__(self, key, /)
| Return self[key].
|
|
str.__getnewargs__
|
| __getnewargs__(...)
|
|
str.__gt__
|
| __gt__(self, value, /)
| Return self>value.
|
|
str.__hash__
|
| __hash__(self, /)
| Return hash(self).
|
|
str.__iter__
|
| __iter__(self, /)
| Implement iter(self).
|
|
str.__le__
|
| __le__(self, value, /)
| Return self<=value.
|
|
str.__len__
|
| __len__(self, /)
| Return len(self).
|
|
str.__lt__
|
| __lt__(self, value, /)
| Return self<value.
|
|
str.__mod__
|
| __mod__(self, value, /)
| Return self%value.
|
|
str.__mul__
|
| __mul__(self, value, /)
| Return self*value.
|
|
str.__ne__
|
| __ne__(self, value, /)
| Return self!=value.
|
|
str.__repr__
|
| __repr__(self, /)
| Return repr(self).
|
|
str.__rmod__
|
| __rmod__(self, value, /)
| Return value%self.
|
|
str.__rmul__
|
| __rmul__(self, value, /)
| Return value*self.
|
|
str.__sizeof__
|
| __sizeof__(self, /)
| Return the size of the string in memory, in bytes.
|
|
str.__str__
|
| __str__(self, /)
| Return str(self).
|
|
str.capitalize
|
| capitalize(self, /)
| Return a capitalized version of the string.
|
| More specifically, make the first character have upper case and the rest lower
| case.
|
|
str.casefold
|
| casefold(self, /)
| Return a version of the string suitable for caseless comparisons.
|
|
str.center
|
| center(self, width, fillchar=' ', /)
| Return a centered string of length width.
|
| Padding is done using the specified fill character (default is a space).
|
|
str.count
|
| count(...)
| S.count(sub[, start[, end]]) -> int
|
| Return the number of non-overlapping occurrences of substring sub in
| string S[start:end]. Optional arguments start and end are
| interpreted as in slice notation.
|
|
str.encode
|
| encode(self, /, encoding='utf-8', errors='strict')
| Encode the string using the codec registered for encoding.
|
| encoding
| The encoding in which to encode the string.
| errors
| The error handling scheme to use for encoding errors.
| The default is 'strict' meaning that encoding errors raise a
| UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
| 'xmlcharrefreplace' as well as any other name registered with
| codecs.register_error that can handle UnicodeEncodeErrors.
|
|
str.endswith
|
| endswith(...)
| S.endswith(suffix[, start[, end]]) -> bool
|
| Return True if S ends with the specified suffix, False otherwise.
| With optional start, test S beginning at that position.
| With optional end, stop comparing S at that position.
| suffix can also be a tuple of strings to try.
|
|
str.expandtabs
|
| expandtabs(self, /, tabsize=8)
| Return a copy where all tab characters are expanded using spaces.
|
| If tabsize is not given, a tab size of 8 characters is assumed.
|
|
str.find
|
| find(...)
| S.find(sub[, start[, end]]) -> int
|
| Return the lowest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Return -1 on failure.
|
|
str.format
|
| format(...)
| S.format(*args, **kwargs) -> str
|
| Return a formatted version of S, using substitutions from args and kwargs.
| The substitutions are identified by braces ('{' and '}').
|
|
str.format_map
|
| format_map(...)
| S.format_map(mapping) -> str
|
| Return a formatted version of S, using substitutions from mapping.
| The substitutions are identified by braces ('{' and '}').
|
|
str.index
|
| index(...)
| S.index(sub[, start[, end]]) -> int
|
| Return the lowest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Raises ValueError when the substring is not found.
|
|
str.isalnum
|
| isalnum(self, /)
| Return True if the string is an alpha-numeric string, False otherwise.
|
| A string is alpha-numeric if all characters in the string are alpha-numeric and
| there is at least one character in the string.
|
|
str.isalpha
|
| isalpha(self, /)
| Return True if the string is an alphabetic string, False otherwise.
|
| A string is alphabetic if all characters in the string are alphabetic and there
| is at least one character in the string.
|
|
str.isascii
|
| isascii(self, /)
| Return True if all characters in the string are ASCII, False otherwise.
|
| ASCII characters have code points in the range U+0000-U+007F.
| Empty string is ASCII too.
|
|
str.isdecimal
|
| isdecimal(self, /)
| Return True if the string is a decimal string, False otherwise.
|
| A string is a decimal string if all characters in the string are decimal and
| there is at least one character in the string.
|
|
str.isdigit
|
| isdigit(self, /)
| Return True if the string is a digit string, False otherwise.
|
| A string is a digit string if all characters in the string are digits and there
| is at least one character in the string.
|
|
str.isidentifier
|
| isidentifier(self, /)
| Return True if the string is a valid Python identifier, False otherwise.
|
| Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
| such as "def" or "class".
|
|
str.islower
|
| islower(self, /)
| Return True if the string is a lowercase string, False otherwise.
|
| A string is lowercase if all cased characters in the string are lowercase and
| there is at least one cased character in the string.
|
|
str.isnumeric
|
| isnumeric(self, /)
| Return True if the string is a numeric string, False otherwise.
|
| A string is numeric if all characters in the string are numeric and there is at
| least one character in the string.
|
|
str.isprintable
|
| isprintable(self, /)
| Return True if the string is printable, False otherwise.
|
| A string is printable if all of its characters are considered printable in
| repr() or if it is empty.
|
|
str.isspace
|
| isspace(self, /)
| Return True if the string is a whitespace string, False otherwise.
|
| A string is whitespace if all characters in the string are whitespace and there
| is at least one character in the string.
|
|
str.istitle
|
| istitle(self, /)
| Return True if the string is a title-cased string, False otherwise.
|
| In a title-cased string, upper- and title-case characters may only
| follow uncased characters and lowercase characters only cased ones.
|
|
str.isupper
|
| isupper(self, /)
| Return True if the string is an uppercase string, False otherwise.
|
| A string is uppercase if all cased characters in the string are uppercase and
| there is at least one cased character in the string.
|
|
str.join
|
| join(self, iterable, /)
| 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'
|
|
str.ljust
|
| ljust(self, width, fillchar=' ', /)
| Return a left-justified string of length width.
|
| Padding is done using the specified fill character (default is a space).
|
|
str.lower
|
| lower(self, /)
| Return a copy of the string converted to lowercase.
|
|
str.lstrip
|
| lstrip(self, chars=None, /)
| Return a copy of the string with leading whitespace removed.
|
| If chars is given and not None, remove characters in chars instead.
|
|
str.partition
|
| partition(self, sep, /)
| 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.
|
|
str.removeprefix
|
| removeprefix(self, prefix, /)
| 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.
|
|
str.removesuffix
|
| removesuffix(self, suffix, /)
| 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.
|
|
str.replace
|
| replace(self, old, new, count=-1, /)
| 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.
|
|
str.rfind
|
| rfind(...)
| S.rfind(sub[, start[, end]]) -> int
|
| Return the highest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Return -1 on failure.
|
|
str.rindex
|
| rindex(...)
| S.rindex(sub[, start[, end]]) -> int
|
| Return the highest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Raises ValueError when the substring is not found.
|
|
str.rjust
|
| rjust(self, width, fillchar=' ', /)
| Return a right-justified string of length width.
|
| Padding is done using the specified fill character (default is a space).
|
|
str.rpartition
|
| rpartition(self, sep, /)
| 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.
|
|
str.rsplit
|
| rsplit(self, /, sep=None, maxsplit=-1)
| Return a list of the words in the string, using sep as the delimiter string.
|
| sep
| The delimiter according which to split the string.
| None (the default value) means split according to any whitespace,
| and discard empty strings from the result.
| maxsplit
| Maximum number of splits to do.
| -1 (the default value) means no limit.
|
| Splits are done starting at the end of the string and working to the front.
|
|
str.rstrip
|
| rstrip(self, chars=None, /)
| Return a copy of the string with trailing whitespace removed.
|
| If chars is given and not None, remove characters in chars instead.
|
|
str.split
|
| split(self, /, sep=None, maxsplit=-1)
| Return a list of the words in the string, using sep as the delimiter string.
|
| sep
| The delimiter according which to split the string.
| None (the default value) means split according to any whitespace,
| and discard empty strings from the result.
| maxsplit
| Maximum number of splits to do.
| -1 (the default value) means no limit.
|
|
str.splitlines
|
| splitlines(self, /, keepends=False)
| 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.
|
|
str.startswith
|
| startswith(...)
| S.startswith(prefix[, start[, end]]) -> bool
|
| Return True if S starts with the specified prefix, False otherwise.
| With optional start, test S beginning at that position.
| With optional end, stop comparing S at that position.
| prefix can also be a tuple of strings to try.
|
|
str.strip
|
| strip(self, chars=None, /)
| Return a copy of the string with leading and trailing whitespace removed.
|
| If chars is given and not None, remove characters in chars instead.
|
|
str.swapcase
|
| swapcase(self, /)
| Convert uppercase characters to lowercase and lowercase characters to uppercase.
|
|
str.title
|
| title(self, /)
| 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.
|
|
str.translate
|
| translate(self, table, /)
| 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.
|
|
str.upper
|
| upper(self, /)
| Return a copy of the string converted to uppercase.
|
|
str.zfill
|
| zfill(self, width, /)
| Pad a numeric string with zeros on the left, to fill a field of the given width.
|
| The string is never truncated.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.str:
|
|
str.__new__
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
|
str.maketrans
|
| maketrans(...)
| Return a translation table usable for str.translate().
|
| If there is only one argument, it must be a dictionary mapping Unicode
| ordinals (integers) or characters to Unicode ordinals, strings or None.
| Character keys will be then converted to ordinals.
| If there are two arguments, they must be strings of equal length, and
| in the resulting dictionary, each character in x will be mapped to the
| character at the same position in y. If there is a third argument, it
| must be a string, whose characters will be mapped to None in the result.
|
| ----------------------------------------------------------------------
| Methods inherited from ShowPrint:
|
|
ShowPrint.show
|
| show(self, *args, **kwargs)
StrEnum
class StrEnum(builtins.str, ImportEnum)
| StrEnum(value, names=None, *, module=None, qualname=None, type=None, start=1)
|
| An `ImportEnum` that behaves like a `str`
|
| Method resolution order:
| StrEnum
| builtins.str
| ImportEnum
| enum.Enum
| builtins.object
|
| Data descriptors inherited from enum.Enum:
|
| name
| The name of the Enum member.
|
| value
| The value of the Enum member.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from enum.EnumMeta:
|
| __members__
| Returns a mapping of member name->value.
|
| This mapping lists all enum members, including aliases. Note that this
| is a read-only view of the internal mapping.
bind
class bind(builtins.object)
| bind(func, *pargs, **pkwargs)
|
| Same as `partial`, except you can use `arg0` `arg1` etc param placeholders
|
| Methods defined here:
|
|
bind.__call__
|
| __call__(self, *args, **kwargs)
| Call self as a function.
|
|
bind.__init__
|
| __init__(self, func, *pargs, **pkwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
fastuple
class fastuple(builtins.tuple)
| fastuple(x=None, *rest)
|
| A `tuple` with elementwise ops and more friendly __init__ behavior
|
| Method resolution order:
| fastuple
| builtins.tuple
| builtins.object
|
| Methods defined here:
|
|
_get_op.<locals>._f
|
| __abs__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __and__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __floordiv__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __invert__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __lshift__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __matmul__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __mod__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __neg__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __or__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __pos__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __pow__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __rshift__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __sub__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __truediv__ = _f(self, *args)
|
|
_get_op.<locals>._f
|
| __xor__ = _f(self, *args)
|
|
fastuple.add
|
| add(self, *args)
| `+` is already defined in `tuple` for concat, so use `add` instead
|
|
_get_op.<locals>._f
|
| eq = _f(self, *args)
|
|
_get_op.<locals>._f
|
| ge = _f(self, *args)
|
|
_get_op.<locals>._f
|
| gt = _f(self, *args)
|
|
_get_op.<locals>._f
|
| le = _f(self, *args)
|
|
_get_op.<locals>._f
|
| lt = _f(self, *args)
|
|
_get_op.<locals>._f
|
| max = _f(self, *args)
|
|
_get_op.<locals>._f
|
| min = _f(self, *args)
|
|
fastuple.mul
|
| mul(self, *args)
| `*` is already defined in `tuple` for replicating, so use `mul` instead
|
|
_get_op.<locals>._f
|
| ne = _f(self, *args)
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
|
fastuple.__new__
|
| __new__(cls, x=None, *rest)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.tuple:
|
|
tuple.__add__
|
| __add__(self, value, /)
| Return self+value.
|
|
tuple.__contains__
|
| __contains__(self, key, /)
| Return key in self.
|
|
tuple.__eq__
|
| __eq__(self, value, /)
| Return self==value.
|
|
tuple.__ge__
|
| __ge__(self, value, /)
| Return self>=value.
|
|
tuple.__getattribute__
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
|
tuple.__getitem__
|
| __getitem__(self, key, /)
| Return self[key].
|
|
tuple.__getnewargs__
|
| __getnewargs__(self, /)
|
|
tuple.__gt__
|
| __gt__(self, value, /)
| Return self>value.
|
|
tuple.__hash__
|
| __hash__(self, /)
| Return hash(self).
|
|
tuple.__iter__
|
| __iter__(self, /)
| Implement iter(self).
|
|
tuple.__le__
|
| __le__(self, value, /)
| Return self<=value.
|
|
tuple.__len__
|
| __len__(self, /)
| Return len(self).
|
|
tuple.__lt__
|
| __lt__(self, value, /)
| Return self<value.
|
|
tuple.__mul__
|
| __mul__(self, value, /)
| Return self*value.
|
|
tuple.__ne__
|
| __ne__(self, value, /)
| Return self!=value.
|
|
tuple.__repr__
|
| __repr__(self, /)
| Return repr(self).
|
|
tuple.__rmul__
|
| __rmul__(self, value, /)
| Return value*self.
|
|
tuple.count
|
| count(self, value, /)
| Return number of occurrences of value.
|
|
tuple.index
|
| index(self, value, start=0, stop=9223372036854775807, /)
| Return first index of value.
|
| Raises ValueError if the value is not present.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.tuple:
|
|
fastuple.__class_getitem__
|
| __class_getitem__(...) from builtins.type
| See PEP 585
ignore_exceptions
class ignore_exceptions(builtins.object)
| Context manager to ignore exceptions
|
| Methods defined here:
|
|
ignore_exceptions.__enter__
|
| __enter__(self)
|
|
ignore_exceptions.__exit__
|
| __exit__(self, *args)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
Functions
add
add(a, b=