Python Worst Practices

Ethan Furman ethan at stoneleaf.us
Sat Feb 28 02:51:49 EST 2015


On 02/27/2015 10:36 PM, Steven D'Aprano wrote:
> Dan Sommers wrote:
> 
>> On Sat, 28 Feb 2015 12:09:31 +1100, Steven D'Aprano wrote:
>>
>>> There's no harm in calling a local variable "id", if you don't use the
>>> built-in id() inside that function. That's one of the reasons why
>>> functions exist, so that the names you use inside a function are distinct
>>> from those outside.
>>
>> And thank goodness for that!  I've been writing Python code since 1997
>> and version 1.5.<something>,¹ and I still do a double take when emacs
>> colors all my ids that faint blue that means "builtin."
> 
> Although it is not helpful for people using screen-readers, and may be of
> limited use to the colour-blind, I am in favour of colourising built-ins so
> they stand out.

Sure, for the ones I use as built-ins.  But I went through the color file for vim and took out the built-ins I use
regularly as variables -- and 'id' was the first one to go.

--
~Ethan~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20150227/9ff51f8f/attachment.sig>


More information about the Python-list mailing list