diveintopython
diveintopython copied to clipboard
5.9 private functions, true but misleading
It should say that when you import a module you import all but stuff that starts with an double underscore. But you CAN use double underscored methods/attributes from a class in your environment, and when you need init method for a module you have to call it init (pygame.init())
P.S. It says: Private functions, which can't be called from outside their module Private class methods, which can't be called from outside their class Private attributes, which can't be accessed from outside their class. It should say: Private functions, which can't be called from outside their module Private class methods, which shouldn't be called from outside their class Private attributes, which shouldn't be accessed from outside their class.
(I hate __ is for bold.)
@CrazyPhython you should use ` for inline code.