Re: [Pyobjc-dev] __getitem__objectForKey_ shadows __getitem__
Brought to you by:
ronaldoussoren
From: James R E. <Jam...@lr...> - 2009-10-09 14:59:55
|
On 9 oct. 2009, at 16:53, Ronald Oussoren wrote: > PyObjC currently blindly adds its own version of __getitem__ when it > detects that a Cocoa class implements objectForKey: or > objectAtIndex:. It should be easy enough to check that the Cocoa > class doesn't have its own version of __getitem__ before adding the > generic version. Is the method I suggested to do that appropriate, or does it look like it should have unforeseen consequences? > BTW. In the longer run (that is, post 2.2 final) I will remove this > logic and switch to class-based logic instead. That is, rather then > looking for objectForKey: I'll add a list of classes that will get a > __getitem__ implementation. Yikes. In that case, I'll uncomment my own __getitem__ handlers, even though it's currently a dead code path. I don't want that interface to suddenly break in a future PyObjC. Cheers! James -- James R. Eagan LRI — Bâtiment 490 Université de Paris-Sud XI email: Jam...@lr... 91405 Orsay Cedex — France web: http://www.lri.fr/~eaganj |