Ask Your Question
0

_zero_element()

asked 12 years ago

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 ......

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 12 years ago

Volker Braun gravatar image

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

Preview: (hide)
link

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 248 times

Last updated: Oct 30 '12