Open Marlysson opened 8 years ago
Verificate whether the method change_bit(position) just operate over a instance of Frame just change bit
change_bit(position)
frame = Frame("001") frame.change_bit(2) >>> frame Frame("011")
Or make your operation and return a new instance of Frame ( immutable objects )
frame = Frame("001") changed = frame.change_bit(2) >>> changed Frame("011")
If the Frame's representation works through a string, maybe it's a good idea return a new instance. That's the default operation in immutable objects anyway.
Verificate whether the method
change_bit(position)
just operate over a instance of Frame just change bitOr make your operation and return a new instance of Frame ( immutable objects )