|
RE: Overloading !=: msg#00035lang.jython.user
[ A Bewes ] > Apologies, bitwise not is the "~" symbol. > Meaning I'll have to implement __invert__(..) > Still, are there any plans in Jython to > allow overloading of the logical operators? > > This would be more intuitive to users of my exposed API e.g: > > >>>CD3 = CD1 > 5 and not CD2 > 10 #better than > >>>CD3 = (CD1 > 5) & ~(CD2 > 10) #i know this can be expressed > differently > ;-) Just a thought: if __gt__() returns a boolean, you can already use the syntax from the first line. On the other hand, if __gt__() returns a java.lang.Object, and this object's class implements __nonzero__(), you should also be able to use >>> not CD2 > 10 But I'd rather use boolean as return value. Best wishes, Oti. __________________________________________________ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com ------------------------------------------------------- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Looking for a telnetlib/select package for use in Jython., brian zimmer |
|---|---|
| Next by Date: | Anyone going to PyCon?, Tom |
| Previous by Thread: | RE: Overloading !=, A Bewes |
| Next by Thread: | PythonInterpreter and Python 11, Michel Pelletier |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |