[Pyobjc-dev] [ pyobjc-Bugs-836336 ] Lots of typing involved for selectors that map to keywords
Brought to you by:
ronaldoussoren
From: SourceForge.net <no...@so...> - 2003-11-05 08:39:45
|
Bugs item #836336, was opened at 2003-11-05 03:39 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=836336&group_id=14534 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Bob Ippolito (etrepum) Assigned to: Nobody/Anonymous (nobody) Summary: Lots of typing involved for selectors that map to keywords Initial Comment: For example: >>> from Foundation import NSObject >>> import keyword >>> [kw for kw in keyword.kwlist if kw in NSObject.__dict__] ['class'] I'm not currently aware of any commonly used ObjC classes that use keywords for selectors.. however, that doesn't mean that there won't be any. Yes, I know this example is stupid because there is __class__, but there isn't special treatment for selectors called "pass" "assert", etc. Workarounds: NSObject.__dict__['class'] getattr(NSObject, 'class') Proposed solution: NSObject.class__ ? Appending two underscores seems like the logical thing to do.. prepending them makes you think special method or private implementation, but appending two could do the trick. Since there aren't any keywords with underscores in them, it's pretty clear that the selector for this is "class". ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=836336&group_id=14534 |