Is it bad style to override the built-in function `type`?

Ramchandra Apte maniandram01 at gmail.com
Sun Nov 25 02:02:07 EST 2012


On Friday, 23 November 2012 21:42:39 UTC+5:30, Michael Herrmann  wrote:
> Hi, 
> 
> 
> 
> do you think it's bad style to override the built-in function `type`? I'm co-developing a GUI automation library called Automa (http://www.getautoma.com) and 'type' would be a very fitting name for a function that generates artificial key strokes. 
> 
> 
> 
> This post is motivated by an already lengthy discussion on this mailing list (http://bit.ly/10aOy4H), where we tried to find alternative names for `type`. Many were found, but none are quite as fitting as 'type'. 
> 
> 
> 
> For the sake of avoiding a discussion that is already being lead elsewhere please confine this thread to what you generally think about overriding `type`, and post suggestions for alternative names or solutions in the other thread.
> 
> 
> 
> Thank you very much!
> 
> Michael

Deleting getattr causes problems with IDLE.
Also, the accepted answer to http://stackoverflow.com/questions/9109333/is-it-bad-practice-to-use-a-built-in-function-name-as-an-attribute-or-method-ide is not correct.
See http://bugs.python.org/issue15113#msg163272 .



More information about the Python-list mailing list