[Python-ideas] Mitigating 'self.' Method Pollution

Serhiy Storchaka storchaka at gmail.com
Sat Jul 11 18:37:00 CEST 2015


On 11.07.15 18:39, David Mertz wrote:
> On Jul 11, 2015 1:40 AM, "Nick Coghlan"
> <ncoghlan at gmail.com
> <mailto:ncoghlan at gmail.com>> wrote:
>  > Alternative proposal:
>  >
>  >     def keep_moving_gravity(self):
>  >         .y += .gravity
>  >         .y = max(.y, 0)
>  >         .y = min(.y, height - 1)
>
> Assuming the parser could be made to handle this (which feels like a big
> stipulation), this variation would deal with the non-explicit dynamic
> scoping bug magnets.
>
> It might violate the "looks like grit on Tim's screen" principle, but it
> is explicit.  I'd only be -0 or -0.5 on this idea.
>
> Since we have Unicode though, how about:
>
>      •y += •gravity
>
> Or
>
>      ∆y += ∆gravity

Brilliant proposal! Unfortunately ∆ is indistinguishable from Δ in many 
fonts, and • can be confused with ◘ or ◦ in selected text.

> Guaranteed no parser ambiguity, and some symbols are bigger than grit.
> In fact, maybe we could get the Unicode Consortium to add a glyph that
> looked like 'self.' To make it stand out even better.

May be use ⾃ (KANGXI RADICAL SELF)?



More information about the Python-ideas mailing list