[Python-Dev] Identifier API (original) (raw)
Georg Brandl g.brandl at gmx.net
Sat Oct 15 06:51:28 CEST 2011
- Previous message: [Python-Dev] Identifier API
- Next message: [Python-Dev] Identifier API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Am 15.10.2011 01:32, schrieb Greg Ewing:
Martin v. Löwis wrote:
That wouldn't be instead, but in addition - you need the variable name, anyway. But the details of exactly how the name is constructed could be kept as an implementation detail.
Is there a use case for keeping that detail hidden?
Not sure whether there is actually a gain in readability - people not familiar with this would assume that it's a function call of some kind, which it would not be. To me the benefit would be that the name you write as the argument would be exactly the identifier it represents. If you have to manually add a prefix, there's room for a bit of confusion, especially if the prefix itself ends with an underscore. E.g. if the identifier is "init" and the prefix is "PyID", do you write "PyID_init" (two underscores) or "PyID_init_"_ (three underscores?) And can you easily spot the difference in your editor?
The compiler can, very easily.
Georg
- Previous message: [Python-Dev] Identifier API
- Next message: [Python-Dev] Identifier API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]