apardon at forel.vub.ac.be
Thu Jan 13 08:47:46 CET 2005
Op 2005-01-12, It's me schreef <itsme at yahoo.com>:
> Precisely. One have to convert complex number into vectors, and vector of
> complex numbers into vector of vectors, list of complex numbers into list of
> vectors, ...., you get the idea.
Wrong. My vector example was an illustration that you can build a user
class that behaves as you want. Python doesn't has a vecor class build
in. Yet I could write a vector class that behaved as you wished with
regard to your twice function.
What can be done for a vector class can be done again for a complex
class, no need to use the vector class for complex numbers.
> And my code no longer look like the equation I have on paper...
> Like I said, I've travelled down that path before with C++ and Modelica.
> It gets ugly.
Ugly, where? In the implementation of the class? That is possible.
In the use of the class, as you suggest by writing that
your code no longer looks like the equation you have on paper.
In that case I suggest the class was poorly done.
More information about the Python-list