Ask Your Question


asked 2012-10-29 16:19:11 +0200

SLOtoSF gravatar image

I have a Ring R which I made and a method to return the zero element of that ring.

I want to be able to type R(0) and have it return the zero element.

I have tried, and it works if I call the method directly, but not if I use R(0). Any tips?

class MyRing(Ring): .... def _zero_element(self): return ......

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-10-30 07:39:59 +0200

Volker Braun gravatar image

If you want R(0) to return the neutral element you need to implement that yourself in your _element_constructor_.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-10-29 16:19:11 +0200

Seen: 195 times

Last updated: Oct 30 '12