On Wed, Jun 6, 2012 at 3:25 PM, Tom Bachmann <[email protected]> wrote:
> Hi,
>
> I *think* the reason why basic does not accept keyword arguments is that all
> arguments are stored in the tuple self.args, and when providing them by
> keyword they have no canonical order any more.

Oh, that makes sense.

> I think the best way to go is to do
>
> class MyClass(Basic):
>    def __new__(cls, arg1="foo", arg2="bar")
>        return Basic.__new__(cls, arg1, arg2)
>
> i.e. to manually provide a canonical argument order.

Aha, great.  I was feeling uneasy about not supplying any arguments to
Basic's __new__.

> I don't think this should break anything - plenty of sympy objects provide
> their own __new__ (all relying on Basic.__new__ eventually, as far as I
> know).

Great!

Thank you for the explanation!

Sergiu

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to