[Raymond Hettinger] >> Rather than munge existing syntaxes, an altogether new one would be >> more clear: >> >> self->name = self.metadata->name [Ben North] > One thing which comes to mind about this one is that, for C/C++ > programmers, the difference between > > obj.member and obj->member > > is the interpretation of the thing on the *left* of the dot or arrow, > whereas the PEP is discussing a new interpretation of the thing on the > *right* of the dot. Try not to get hung-up on meanings from other languages. Any simple syntax will have associations in other languages. It is more important that we don't create a syntax which already has strong associations in Python (i.e. curly braces, dots, and square brackets). Those syntaxes would make the language harder to mentally parse. I would like to give the -> syntax a chance as is it simple and it is provides a nice visual distinction between closely related concepts: a.name -- getattr(a, 'name') a->name -- getattr(a, name) Raymond
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4