Okay. So, this is what happens if I use __init__:

Symbol.__new__ is called. Here's the definition:

def __new__(cls, name, **assumptions):
       """Symbols are identified by name and assumptions::

As you can see, the method expects 2 positional arguments and rest are 
keyword arguments (the assumptions). When I use __init__, the function call 
is something like this:

def __init__(self, name, coord_sys, position, **assumptions):

And that's the error.

Now, even if I can use __init__, here's what will happen:

Symbol.__new__ still gets called first. Inside Symbol.__new__, it makes 
this call:
return Symbol.__xnew_cached_(cls, name, **assumptions)

The method __xnew_cached is cached. So, if the symbol with the same name 
had already been defined, that gets returned instead of a new object. 
Therefore, we are back to our original problem - that symbol doesn't 
support any extra args. In fact, if we have a symbol, doing:
>>> symbol.args
returns an empty tuple.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to