Another newbie question

Paul Rubin http
Sat Dec 10 19:41:21 EST 2005


aleax at mail.comcast.net (Alex Martelli) writes:
> You could make a case for a "2D coordinate" class being "sufficiently
> primitive" to have immutable instances, of course (by analogy with
> numbers and strings) -- in that design, you would provide no mutators,
> and therefore neither would you provide setters (with any syntax) for x
> and y, obviously.  However, a framework for 2D geometry entirely based
> on immutable-instance classes would probably be unwieldy

I could imagine using Python's built-in complex numbers to represent
2D points.  They're immutable, last I checked.  I don't see a big
conflict.



More information about the Python-list mailing list