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=)
    Same as `operator.add`, or returns partial if 1 arg

add_props

add_props(f, g=None, n=2)
    Create properties passing each of `range(n)` to f

anno_ret

anno_ret(func)
    Get the return annotation of `func`

annotations

annotations(o)
    Annotations for `o`, or `type(o)`

argnames

argnames(f, frame=False)
    Names of arguments to function or frame `f`

argwhere

argwhere(iterable, f, negate=False, **kwargs)
    Like `filter_ex`, but return indices for matching items

attrdict

attrdict(o, *ks, default=None)
    Dict from each `k` in `ks` to `getattr(o,k)`

basic_repr

basic_repr(flds=None)
    Minimal `__repr__`

camel2snake

camel2snake(name)
    Convert CamelCase to snake_case

camel2words

camel2words(s, space=' ')
    Convert CamelCase to 'spaced words'

chunked

chunked(it, chunk_sz=None, drop_last=False, n_chunks=None)
    Return batches from iterator `it` of size `chunk_sz` (or return `n_chunks` total)

class2attr

class2attr(self, cls_name)
    Return the snake-cased name of the class; strip ending `cls_name` if it exists.

compile_re

compile_re(pat)
    Compile `pat` if it's not None

compose

compose(*funcs, order=None)
    Create a function that composes all functions in `funcs`, passing along remaining `*args` and `**kwargs` to all

concat

concat(colls) -> list
    Concatenate all collections and items as a list

copy_func

copy_func(f)
    Copy a non-builtin function (NB `copy.copy` does not work for this)

custom_dir

custom_dir(c, add)
    Implement custom `__dir__`, adding `add` to `cls`

cycle

cycle(o)
    Like `itertools.cycle` except creates list of `None`s if `o` is empty

delegate_attr

delegate_attr(self, k, to)
    Use in `__getattr__` to delegate to attr `to` without inheriting from `GetAttr`

detuplify

detuplify(x)
    If `x` is a tuple with one thing, extract it

eq

eq(a, b=)
    Same as `operator.eq`, or returns partial if 1 arg

eval_type

eval_type(t, glb, loc)
    `eval` a type or collection of types, if needed, for annotations in py3.10+

even_mults

even_mults(start, stop, n)
    Build log-stepped array from `start` to `stop` in `n` steps.

exec_import

exec_import(mod, sym)
    Import `sym` from `mod` in a new environment

exec_local

exec_local(code, var_name)
    Call `exec` on `code` and return the var `var_name

exec_new

exec_new(code)
    Execute `code` in a new environment and return it

filter_dict

filter_dict(d, func)
    Filter a `dict` using `func`, applied to keys and values

filter_ex

filter_ex(iterable, f=, negate=False, gen=False, **kwargs)
    Like `filter`, but passing `kwargs` to `f`, defaulting `f` to `noop`, and adding `negate` and `gen`

filter_keys

filter_keys(d, func)
    Filter a `dict` using `func`, applied to keys

filter_values

filter_values(d, func)
    Filter a `dict` using `func`, applied to values

first

first(x, f=None, negate=False, **kwargs)
    First element of `x`, optionally filtered by `f`, or None if missing

flatten

flatten(o)
    Concatenate all collections and items as a generator

ge

ge(a, b=)
    Same as `operator.ge`, or returns partial if 1 arg

gen

gen(func, seq, cond=)
    Like `(func(o) for o in seq if cond(func(o)))` but handles `StopIteration`

get_annotations_ex

get_annotations_ex(obj, *, globals=None, locals=None)
    Backport of py3.10 `get_annotations` that returns globals/locals

get_class

get_class(nm, *fld_names, sup=None, doc=None, funcs=None, **flds)
    Dynamically create a class, optionally inheriting from `sup`, containing `fld_names`

getattrs

getattrs(o, *attrs, default=None)
    List of all `attrs` in `o`

getcallable

getcallable(o, attr)
    Calls `getattr` with a default of `noop`

groupby

groupby(x, key, val=)
    Like `itertools.groupby` but doesn't need to be sorted, and isn't lazy, plus some extensions

gt

gt(a, b=)
    Same as `operator.gt`, or returns partial if 1 arg

hasattrs

hasattrs(o, attrs)
    Test whether `o` contains all `attrs`

ifnone

ifnone(a, b)
    `b` if `a` is None else `a`

in_

in_(a, b=)
    Same as `operator.in_`, or returns partial if 1 arg

instantiate

instantiate(t)
    Instantiate `t` if it's a type, otherwise do nothing

is_

is_(a, b=)
    Same as `operator.is_`, or returns partial if 1 arg

is_array

is_array(x)
    `True` if `x` supports `__array__` or `iloc`

is_not

is_not(a, b=)
    Same as `operator.is_not`, or returns partial if 1 arg

last_index

last_index(x, o)
    Finds the last index of occurence of `x` in `o` (returns -1 if no occurence)

le

le(a, b=)
    Same as `operator.le`, or returns partial if 1 arg

listify

listify(o=None, *rest, use_list=False, match=None)
    Convert `o` to a `list`

loop_first

loop_first(values)
    Iterate and generate a tuple with a flag for first value.

loop_first_last

loop_first_last(values)
    Iterate and generate a tuple with a flag for first and last value.

loop_last

loop_last(values)
    Iterate and generate a tuple with a flag for last value.

lt

lt(a, b=)
    Same as `operator.lt`, or returns partial if 1 arg

map_ex

map_ex(iterable, f, *args, gen=False, **kwargs)
    Like `map`, but use `bind`, and supports `str` and indexing

maps

maps(*args, retain=)
    Like `map`, except funcs are composed first

mapt

mapt(func, *iterables)
    Tuplified `map`

maybe_attr

maybe_attr(o, attr)
    `getattr(o,attr,o)`

merge

merge(*ds)
    Merge all dictionaries in `ds`

mk_class

mk_class(nm, *fld_names, sup=None, doc=None, funcs=None, mod=None, **flds)
    Create a class using `get_class` and add to the caller's module

mul

mul(a, b=)
    Same as `operator.mul`, or returns partial if 1 arg

ne

ne(a, b=)
    Same as `operator.ne`, or returns partial if 1 arg

nested_attr

nested_attr(o, attr, default=None)
    Same as `getattr`, but if `attr` includes a `.`, then looks inside nested objects

nested_callable

nested_callable(o, attr)
    Same as `nested_attr` but if not found will return `noop`

nested_idx

nested_idx(coll, *idxs)
    Index into nested collections, dicts, etc, with `idxs`

nested_setdefault

nested_setdefault(o, attr, default)
    Same as `setdefault`, but if `attr` includes a `.`, then looks inside nested objects

not_

not_(f)
    Create new function that negates result of `f`

num_cpus

num_cpus()
    Get number of cpus

only

only(o)
    Return the only item of `o`, raise if `o` doesn't have exactly one item

otherwise

otherwise(x, tst, y)
    `y if tst(x) else x`

partialler

partialler(f, *args, order=None, **kwargs)
    Like `functools.partial` but also copies over docstring

patch

patch(f=None, *, as_prop=False, cls_method=False)
    Decorator: add `f` to the first parameter's class (based on f's type annotations)

patch_property

patch_property(f)
    Deprecated; use `patch(as_prop=True)` instead

patch_to

patch_to(cls, as_prop=False, cls_method=False)
    Decorator: add `f` to `cls`

properties

properties(cls, *ps)
    Change attrs in `cls` with names in `ps` to properties

range_of

range_of(a, b=None, step=None)
    All indices of collection `a`, if `a` is a collection, otherwise `range`

renumerate

renumerate(iterable, start=0)
    Same as `enumerate`, but returns index as 2nd element instead of 1st

replicate

replicate(item, match)
    Create tuple of `item` copied `len(match)` times

ret_false

ret_false(*args, **kwargs)
    Predicate: always `False`

ret_true

ret_true(*args, **kwargs)
    Predicate: always `True`

risinstance

risinstance(types, obj=None)
    Curried `isinstance` but with args reversed

set_nested_idx

set_nested_idx(coll, value, *idxs)
    Set value indexed like `nested_idx

setattrs

setattrs(dest, flds, src)
    # %% ../nbs/01_basics.ipynb 180

setify

setify(o)
    Turn any list like-object into a set.

signature_ex

signature_ex(obj, eval_str: bool = False)
    Backport of `inspect.signature(..., eval_str=True` to <py310

snake2camel

snake2camel(s)
    Convert snake_case to CamelCase

sorted_ex

sorted_ex(iterable, key=None, reverse=False)
    Like `sorted`, but if key is str use `attrgetter`; if int use `itemgetter`

stop

stop(e=)
    Raises exception `e` (by default `StopException`)

store_attr

store_attr(names=None, self=None, but='', cast=False, store_args=None, **attrs)
    Store params named in comma-separated `names` from calling context into attrs in `self`

str2bool

str2bool(s)
    Case-insensitive convert string `s` too a bool (`y`,`yes`,`t`,`true`,`on`,`1`->`True`)

str_enum

str_enum(name, *vals)
    Simplified creation of `StrEnum` types

strcat

strcat(its, sep: str = '') -> str
    Concatenate stringified items `its`

sub

sub(a, b=)
    Same as `operator.sub`, or returns partial if 1 arg

true

true(x)
    Test whether `x` is truthy; collections with >0 elements are considered `True`

truediv

truediv(a, b=)
    Same as `operator.truediv`, or returns partial if 1 arg

try_attrs

try_attrs(obj, *attrs)
    Return first attr that exists in `obj`

tuplify

tuplify(o, use_list=False, match=None)
    Make `o` a tuple

type_hints

type_hints(f)
    Like `typing.get_type_hints` but returns `{}` if not allowed type

typed

typed(f)
    Decorator to check param and return types at runtime

union2tuple

union2tuple(t)
    # %% ../nbs/01_basics.ipynb 124

uniqueify

uniqueify(x, sort=False, bidir=False, start=None)
    Unique elements in `x`, optional `sort`, optional return reverse correspondence, optional prepend with elements.

using_attr

using_attr(f, attr)
    Construct a function which applies `f` to the argument's attribute `attr`

val2idx

val2idx(x)
    Dict from value to index

with_cast

with_cast(f)
    Decorator which uses any parameter annotations as preprocessing functions

wrap_class

wrap_class(nm, *fld_names, sup=None, doc=None, funcs=None, **flds)
    Decorator: makes function a method of a new class `nm` passing parameters to `mk_class`

zip_cycle

zip_cycle(x, *args)
    Like `itertools.zip_longest` but `cycle`s through elements of all but first argument