ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> Jython-users
Jython-users
Re: [Jython-users] ovverride and operator?
by Diez B. Roggisch other posts by this author
Oct 29 2003 1:42PM messages near this date
Re: [Jython-users] ovverride and operator? | Re: [Jython-users] ovverride and operator?
Am Freitag, 10. Oktober 2003 01:54 schrieb Nicola de Candussio:
>  Hi all,
> 
>  is it possible to ovveride the and operator by implementing any specific
>  jyhton method ?
>  I would like to "and" boolean arrays  and have returned the array of the
>  compared boolean elements but I could not find any documentation about it

Radio eriwan says: It depends....

You can overload operators in classes like this:

class Foo:
  def __and__(self, rightOp):
    ...
    return result

However, this doesn't help when you work with built in types. Maybe you can 
create your own array-class, by overloading some other operators as well, but 
I'm currently not sure.

If you'd provide some more details on what you want to do, I'd come up with a 
similar elegant solution, using some higher order functions.

Regards,

Diez



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Jython-users mailing list
Jython-users@[...].net
https://lists.sourceforge.net/lists/listinfo/jython-users
Thread:
Nicola de Candussio
Nicola de Candussio
Diez B. Roggisch
Diez B. Roggisch
Kent Johnson

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved