When doing oop in python where should I add the logger.
Should I add it:
- before the class
Rocket(): and give it a file global scope or - after the class
Rocket(): and give it a class scope.
Syntax allows for both. But which would be consider more correct in the python culture.
Assume I have a class
class Rocket():
# Rocket simulates a rocket ship for a game,
# or a physics simulation.
def __init__(self):
# Each rocket has an (x,y) position.
self.x = 0
self.y = 0
def move_up(self):
# Increment the y-position of the rocket.
self.y += 1