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

Joel Goldstick joel.goldstick at gmail.com
Fri Nov 23 17:22:21 CET 2012


On Fri, Nov 23, 2012 at 11:12 AM, Michael Herrmann <
michael.herrmann at getautoma.com> 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.
>
> Personally, I think this is a horrible idea.  On this list and the tutor
list, people often use variable names that are already defined in the
language.  It leads to non obvious errors -- especially when revisting old
code.  Why not call the thing 'key_stroke'?



> 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
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121123/13ef6eb9/attachment.html>


More information about the Python-list mailing list