|
Re: Null reference: msg#00160programming.swig
On 2003.11.26 10:19, renz@xxxxxxxxxxxxxxxx wrote: Well, there will be no error occurred, if == is not defined for class That's because the default behavior is to compare identity. I thought it should not compare equality, instead it should compare identity. It does by default. But when you define an operator== (or either __eq__ or __cmp__ in Python) you're explicitly specifying that you want to override that behavior. That's not SWIG-specific---look at the following pure Python. ... def __eq__(self,x):class Foo: ... if x is None: ... raise Exception("ni!") ... Traceback (most recent call last):None in [ Foo(), None ] File "<stdin>", line 1, in ? File "<stdin>", line 4, in __eq__ Exception: ni! You can't blame Python for not disregarding what you tell it. Cheers, Luigi _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Passing pointers to longs: 00160, Brian Hawley |
|---|---|
| Next by Date: | Dispatch function (for function overloading) does not use typemap s: 00160, Sluis, Minto van der |
| Previous by Thread: | Re: Null referencei: 00160, Luigi Ballabio |
| Next by Thread: | SWIG-1.3.20 - Report Bugs: 00160, David Beazley |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |