[Python-ideas] Object grabbing
Sven R. Kunze
srkunze at mail.de
Mon May 2 13:04:44 EDT 2016
On 02.05.2016 07:07, Stephen Hansen wrote:
> I seriously don't clean my screen enough to find this an OK syntax.
> "self.x" is perfectly readable, but not because the dot is
> particularly visible, but because the dot is sufficient to combine
> those two parts into a single unit to my eye. It makes the two parts
> blur together more then the dot is, itself, strongly visible.
The same for me.
-1 for this feature.
>
> Every use case I can think of for this feature is better (as defined
> as more readable?) spelled as a local variable, even if its a short
> variable I'd normally argue against, like:
>
> u = team.users[i]
> team.evict_user(u.uid, u.email, "Bye bye")
>
> Normally I don't like variables like 'u', but if they're very local in
> functions that aren't long, they're fine. In those cases where they
> aren't fine, the proposed using's dot syntax would remove from vision
> what you're currently operating on and would therefore not be good either.
In this case, I could even live with "user".
> To me this feature sacrifices readability for writability, and
> readability is more important.
Yep.
Especially, when adding yet another way for "performance reasons".
Python can optimize the presented cases without introducing a new syntax.
Best,
Sven
More information about the Python-ideas
mailing list