Benefits of unicode identifiers (was: Allow additional separator in identifiers)

Chris Angelico rosuav at gmail.com
Thu Nov 23 16:05:42 EST 2017


On Fri, Nov 24, 2017 at 8:02 AM, Mikhail V <mikhailwas at gmail.com> wrote:
> On Thu, Nov 23, 2017 at 9:39 PM, Chris Angelico <rosuav at gmail.com> wrote:
>> On Fri, Nov 24, 2017 at 7:38 AM, Mikhail V <mikhailwas at gmail.com> wrote:
>>> I see you manually 'optimise' the look?
>>> I personally would end with something like this:
>>>
>>> def zip_longest(*A, **K):
>>>     value = K.get ('fillvalue')
>>>     count = len(a) - 1
>>>     def sentinel():
>>>         nonlocal count
>>>         if not count:
>>>             raise ZipExhausted
>>>         count -= 1
>>>         yield  value
>>>     fillers = repeat (value)
>>>     iterators = [chain (it, sentinel(), fillers) for it in A]
>>>     try:
>>>         while iterators:
>>>             yield tuple (map (next, iterators))
>>>     except ZipExhausted:
>>>         pass
>>>
>>>
>>> So I would say, my option would be something inbetween.
>>> Note that I tweaked it for proportional font, namely Times New Roman.
>
>> I don't see how the font applies here, but whatever.
>
> For a different font, say CourierNew (monospaced) the tweaking strategy might
> be different.

If you have ANY font-specific "tweaking", you're doing it wrong.
Thanks for making it look worse on everyone else's screen.

>> Which is better? The one-letter names or the longer ones that tie in with what they're
>> doing?
>
> I think I have answered more or less in previous post, that you cutted off.
> So you were not satisfied?
> But now I am probably not get your 'better' meaning.
> Better for understanding, or purely visually, i.e. less eye-straining?

Which one would you prefer to maintain? Which would you prefer in a code review?

Do you want to have one- and two-letter variable names, or longer and
more descriptive ones?

Seriously? Do I need to wrench this part out of you? This was supposed
to be the EASY question that everyone can agree on, from which I can
then draw my line of argument.

ChrisA



More information about the Python-list mailing list