built-in function

Cards (19)

  • abs()
    Return the absolute value of a number
  • aiter()or x.__aiter__()

    asynchronous iterator
  • all()
    return true if all elements of the iterable are true
  • anext()
    return the next item from the given asynchronous iterator
  • any()
    return True if any element of the iterable is Ture
  • ascii()
    return a string containing a printable representation of an object
  • bin()
    Convert an integer number to a binary string prefixed with “0b”
  • bool()
    Return a Boolean value
  • breakpoint()
    calls sys.breakpointhook() and drops you into the debugger
  • @classmethod
    Transform a method into a class method. A class method receives the class as an implicit first argument, just like an instance method receives the instance.
  • filter
    Construct an iterator from those elements of iterable for which function is true.
    filter(function, iterable)
  • frozenset
    Return a frozenset object with elements taken from iterable.
  • getattr
    Return the value of the named attribute of object
    getattr(x, 'foobar') = x.foobar
  • map
    map(function, iterable, iterables*)
  • map
    from itertools import repeat
    list(map(pow, range(10), repeat(2)))
    # first 10 perfect squares
  • anext() or x.__anext__()

    When awaited, return the next item from the given asynchronous iterator, or default if given and the iterator is exhausted.
  • ord() and chr()
    ord : return an integer representing the Unicode code point of that character
    chr : reverse of ord
  • mro() or __mro__

    Method resolution order lists the method resolution search order used by both getattr() and super()
  • super
    Return a proxy object that delegates method calls to a parent or sibling class of type. This is useful for accessing inherited methods that have been overridden in a class.

    super().method()