Re: "Is" is "is" [was: any way to customize the is operator?]

2006-02-11 Thread Terry Reedy
"> Lonnie Princehouse wrote: >> Calling the wrapped version of this function from Python will produce a >> Python wrapper which represents the same underlying C++ object, but is >> not actually the same Python object: What I think you need is a custom version of the .__eq__ (self,other) method t

Re: any way to customize the is operator?

2006-02-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Lonnie Princehouse <[EMAIL PROTECTED]> wrote: > >> Why did you want to customize "is"? > >Well, mostly out of principle ;-) > >But also because I'm wrapping a C library which passes around C structs >which are wrapped in shim C++ classes for a Boost.Python layer. Bo

"Is" is "is" [was: any way to customize the is operator?]

2006-02-10 Thread Steve Holden
Lonnie Princehouse wrote: >>Why did you want to customize "is"? > > > Well, mostly out of principle ;-) > > But also because I'm wrapping a C library which passes around C structs > which are wrapped in shim C++ classes for a Boost.Python layer. Boost > Python does a marvelous job of translatin

Re: any way to customize the is operator?

2006-02-10 Thread Lonnie Princehouse
> Why did you want to customize "is"? Well, mostly out of principle ;-) But also because I'm wrapping a C library which passes around C structs which are wrapped in shim C++ classes for a Boost.Python layer. Boost Python does a marvelous job of translating between Python and C++ data types; when

Re: any way to customize the is operator?

2006-01-27 Thread Steven D'Aprano
On Thu, 26 Jan 2006 23:26:14 -0800, Lonnie Princehouse wrote: >> (objects are not allowed to lie about who they are, or what they are). > > Dangit! I need to find a less honest programming language. Anyone > have a Perl cookbook handy? ... No, you need a better algorithm. Why did you want to

Re: any way to customize the is operator?

2006-01-27 Thread Sybren Stuvel
Lonnie Princehouse enlightened us with: > There doesn't seem to be any way to customize the behavior of "is" as > can be done for other operators... why not? Pure logic: A == A or A != A. An object is another object or not. Why would you want to change that? Sybren -- The problem with the world

Re: any way to customize the is operator?

2006-01-27 Thread bruno at modulix
Lonnie Princehouse wrote: >>(objects are not allowed to lie about who they are, or what they are). > > > Dangit! I need to find a less honest programming language. Anyone > have a Perl cookbook handy? ... > +1 QOTW (approved by a fellow Perl programmer FWIW !-) -- bruno desthuilliers python

Re: any way to customize the is operator?

2006-01-26 Thread Lonnie Princehouse
> (objects are not allowed to lie about who they are, or what they are). Dangit! I need to find a less honest programming language. Anyone have a Perl cookbook handy? ... -- http://mail.python.org/mailman/listinfo/python-list

Re: any way to customize the is operator?

2006-01-26 Thread Fredrik Lundh
Lonnie Princehouse wrote: > There doesn't seem to be any way to customize the behavior of "is" as > can be done for other operators... why not? because it does "id(a) == id(b)", and there's no way to customize the behaviour of id(). (objects are not allowed to lie about who they are, or what the

any way to customize the is operator?

2006-01-26 Thread Lonnie Princehouse
There doesn't seem to be any way to customize the behavior of "is" as can be done for other operators... why not? -- http://mail.python.org/mailman/listinfo/python-list