2 ms·
There's actually 4 kinds: def foo(... # public def _foo(... # internal def __foo(... # munged def __foo__(... # magic Internal is more convention as t
by Izkata 1y ago
There's actually 4 kinds:
def foo(... # public
def _foo(... # internal
def __foo(... # munged
def __foo__(... # magic
Internal is more convention as the language doesn't really do anything with it, but it does with munged, and magic methods are specifically for things implemented in the language.
Internal and munged don't exactly map to private and protected, but are kinda similar ish.
- freehorse 1y agoOh right. I am not really into python, had read some doc about naming conventions some poitns. In any case I actually like how one can use underscores to point on how exposed some method is supposed to be. Makes it simpler to actually know what to skip and what not.