- Stack Overflow
- Python doc (in French)
- A nice video tutorial on Python OOP
- format method
- methods:
insert
,append
,sort
, etc. - list comprehension
- mutable / immutable object
- built-in functions (
range
,print
,sort
, etc.) - create / execute a function
- parameter / argument
- positional argument
- argument with default value
- key word argument
- lambda function
__name__ == '__main__'
- class variable
- instance method
instance = MyClass() # there's the __eq__ method in MyClass
another_instance = MyClass()
# call
MyClass.__eq__(instance, another_instance)
instance.__eq__(another_instance)
instance == another_instance # overload the == operator with __eq__ method
- magic method (
__init__
,__str__
,__eq__
,__add__
, etc.)
-
use debugger
-
sys.argv[]
-
closure
-
copy, deepcopy
-
id()
,dir()
,help()
-
To check the if two objects is the same
a = 3 b = a a is b # True a = {"one": 1, "two": 2, "three": 3} b = dict(one=1, two=2, three=3) a == b # True a is b # False
-
venv
orvirtualenv
-
use
pylint
(withgraphviz
) to generate uml graph