Home

"andresj" <andres.j.new@gmail.com> wrote in message
news:1191283765.496514.94080@50g2000hsm.googlegroups.com...
|| I know from __future__ import division changes the behaivour to return
| floats instead of ints, but what I meant is to be able to implement a
| function (or class/method) which would return what _I_ want/decide.

When you define your own class, you can make any operator (on instances of
that class) mean anything you want. But to use such methonds, once
defined, you first have to make instances of that class using
classname(init data) or whatever.

There is no way to hijack int op int though.

tjr

previous
next

Re: Why is this loop heavy code so slow in Python? Possible Project Euler spoilers
i need help:""<
Re: Hash map to categorize users.
Re: Something in the function tutorial confused me.
Re: Python syntax wart
Kidprotect
Fundacja Avalon
Niechciane i Zapomniane
Fundacja Hobbit
Krwinka