Newbie: question regarding references and class relationships

Chris Angelico rosuav at gmail.com
Thu Jun 13 10:07:48 EDT 2013


On Thu, Jun 13, 2013 at 10:06 PM, Rui Maciel <rui.maciel at gmail.com> wrote:
> Rick Johnson wrote:
>> Firstly. Why would you define a Point object that holds it's x,y,z values
>> in a list attribute? Why not store them as self.x, self.y and self.z?
> <snip/>
>
> The position in space is represented as a vector, which is then used in a
> series of operations.
>
> Currently I'm using numpy arrays to represent vectors.
>
>
>> Secondly, why would store the position of the Point as a class attribute?
> <snip/>
>
> I've answered this 3 days ago.  I'm still learning Python, and python.org's
> tutorial on classes didn't explicitly covered the differences between class
> and instance attributes.

Just FYI, Rick Johnson (aka Ranting Rick) is a known troll. Don't let
him goad you :)

Follow other people's advice, and take Rick's posts with a grain of
salt. Sometimes he has a good point to make (more often when he's
talking about tkinter, which is his area of expertise), but frequently
he spouts rubbish.

ChrisA



More information about the Python-list mailing list