Whatever you do, DO NOT repeat, DO NOT use Hungarian notation! This causes severe head and bit rot.
So what can you do? Python and C / C ++ are completely different. In C ++, you usually handle polymorphic calls, for example:
void doWithFooThing(FooThing *foo) {
foo->bar();
}
Dynamic polymorphism in C ++ depends on inheritance: a pointer passed to doWithFooThing can only point to instances of FooThing or one of its subclasses. Not so in Python:
def do_with_fooish(fooish):
fooish.bar()
(.. , barableableable bar), , .
, ++, , (base-) , , Python , . , Python, - , , . . :
def some_action(a_list):
...
def some_action(seq):
...
seq , , , , dict, set, iterator, .
, , . :
dict_of_strings_to_dates = {}
:
users_birthdays = {}
, , C/++. , .
: Python . , dicionary:
assert foo.bar == getattr(foo, 'bar') == foo.__dict__['bar']
, , docs.python.org.
, BTW, Python , , C/++. .