Changes between Initial Version and Version 1 of Ticket #945
- Timestamp:
- 03/09/08 00:44:33 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #945 – Description
initial v1 1 1 Easy one: 2 2 3 Write a datatype called BodyPosition. The __cinit__ will take the Body it's to use as a required argument and store it in self.3 Write a datatype called !BodyPosition. The __cinit__ will take the Body it's to use as a required argument and store it in self. 4 4 5 It will appear and work much like a Python list, except no .append .remove .pop etc (since it's size is immutable). Attempts to access or set (__getitem__ and __setitem__ python methods) dimensions > 3 will raise a IndexError: position index out of range5 It will appear and work much like a Python list, except no .append .remove .pop etc (since it's size is immutable). Attempts to access or set (__getitem__ and __setitem__ python methods) dimensions > 3 will raise a !IndexError: position index out of range 6 6 7 Setting one of it's items via BodyPosition[0] = will set the parent instance's ._position[0]. A similar interface could be available viaBodyPosition.x (x property).7 Setting one of it's items via !BodyPosition![0] = will set the parent instance's ._position![0]. A similar interface could be available via !BodyPosition.x (x property). 8 8 9 Body.position.__get__ should return an instance of this class. Body.position.__set__ should accept a tuple, list, or BodyPosition. The latter will copy another Body's .position at that moment.9 Body.position.__get__ should return an instance of this class. Body.position.__set__ should accept a tuple, list, or !BodyPosition. The latter will copy another Body's .position at that moment.



