Skip to content

Instantly share code, notes, and snippets.

@atg
Created March 17, 2016 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atg/7ae3b1aec988eb356887 to your computer and use it in GitHub Desktop.
Save atg/7ae3b1aec988eb356887 to your computer and use it in GitHub Desktop.
~~ bool ~~
bool#type(object) -> the object's type
bool#str(object='') -> str
bool#from_bytes(bytes, byteorder, *, signed=False) -> int
bool#to_bytes(length, byteorder, *, signed=False) -> bytes
~~ bytearray ~~
bytearray#type(object) -> the object's type
bytearray#str(object='') -> str
bytearray#center(width[, fillchar]) -> copy of B
bytearray#count(sub[, start[, end]]) -> int
bytearray#endswith(suffix[, start[, end]]) -> bool
bytearray#expandtabs(tabsize=8) -> copy of B
bytearray#find(sub[, start[, end]]) -> int
bytearray#fromhex('B9 01EF') -> bytearray(b'\\xb9\\x01\\xef')
bytearray#index(sub[, start[, end]]) -> int
bytearray#ljust(width[, fillchar]) -> copy of B
bytearray#rfind(sub[, start[, end]]) -> int
bytearray#rindex(sub[, start[, end]]) -> int
bytearray#rjust(width[, fillchar]) -> copy of B
bytearray#startswith(prefix[, start[, end]]) -> bool
bytearray#zfill(width) -> copy of B
~~ bytes ~~
bytes#type(object) -> the object's type
bytes#str(object='') -> str
bytes#center(width[, fillchar]) -> copy of B
bytes#count(sub[, start[, end]]) -> int
bytes#endswith(suffix[, start[, end]]) -> bool
bytes#expandtabs(tabsize=8) -> copy of B
bytes#find(sub[, start[, end]]) -> int
bytes#fromhex('B9 01EF') -> b'\\xb9\\x01\\xef'.
bytes#index(sub[, start[, end]]) -> int
bytes#'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'.
bytes#ljust(width[, fillchar]) -> copy of B
bytes#rfind(sub[, start[, end]]) -> int
bytes#rindex(sub[, start[, end]]) -> int
bytes#rjust(width[, fillchar]) -> copy of B
bytes#startswith(prefix[, start[, end]]) -> bool
bytes#zfill(width) -> copy of B
~~ complex ~~
complex#type(object) -> the object's type
complex#str(object='') -> str
~~ dict ~~
dict#type(object) -> the object's type
dict#str(object='') -> str
dict#get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
dict#pop(k[,d]) -> v, remove specified key and return the corresponding value.
dict#setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
dict#update([E, ]**F) -> None. Update D from dict/iterable E and F.
~~ float ~~
float#type(object) -> the object's type
float#str(object='') -> str
float#__format__(format_spec) -> string
float#__getformat__(typestr) -> string
float#__setformat__(typestr, fmt) -> None
float#fromhex(string) -> float
~~ frozenset ~~
frozenset#type(object) -> the object's type
frozenset#str(object='') -> str
~~ int ~~
int#type(object) -> the object's type
int#str(object='') -> str
int#from_bytes(bytes, byteorder, *, signed=False) -> int
int#to_bytes(length, byteorder, *, signed=False) -> bytes
~~ list ~~
list#type(object) -> the object's type
list#str(object='') -> str
list#append(object) -> None
list#count(value) -> integer
list#extend(iterable) -> None
list#index(value, [start, [stop]]) -> integer
list#pop([index]) -> item
list#remove(value) -> None
list#sort(key=None, reverse=False) -> None
~~ object ~~
object#type(object) -> the object's type
object#str(object='') -> str
~~ set ~~
set#type(object) -> the object's type
set#str(object='') -> str
~~ slice ~~
slice#type(object) -> the object's type
slice#str(object='') -> str
slice#indices(len) -> (start, stop, stride)
~~ str ~~
str#type(object) -> the object's type
str#str(object='') -> str
str#__format__(format_spec) -> str
str#center(width[, fillchar]) -> str
str#count(sub[, start[, end]]) -> int
str#encode(encoding='utf-8', errors='strict') -> bytes
str#endswith(suffix[, start[, end]]) -> bool
str#expandtabs(tabsize=8) -> str
str#find(sub[, start[, end]]) -> int
str#format(*args, **kwargs) -> str
str#format_map(mapping) -> str
str#index(sub[, start[, end]]) -> int
str#join(iterable) -> str
str#ljust(width[, fillchar]) -> str
str#lstrip([chars]) -> str
str#partition(sep) -> (head, sep, tail)
str#replace(old, new[, count]) -> str
str#rfind(sub[, start[, end]]) -> int
str#rindex(sub[, start[, end]]) -> int
str#rjust(width[, fillchar]) -> str
str#rpartition(sep) -> (head, sep, tail)
str#rsplit(sep=None, maxsplit=-1) -> list of strings
str#rstrip([chars]) -> str
str#split(sep=None, maxsplit=-1) -> list of strings
str#splitlines([keepends]) -> list of strings
str#startswith(prefix[, start[, end]]) -> bool
str#strip([chars]) -> str
str#translate(table) -> str
str#zfill(width) -> str
~~ tuple ~~
tuple#type(object) -> the object's type
tuple#str(object='') -> str
tuple#count(value) -> integer
tuple#index(value, [start, [stop]]) -> integer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment