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

Terry Reedy tjreedy at
Fri Nov 23 19:35:54 CET 2012

On 11/23/2012 11:22 AM, Joel Goldstick wrote:
> On Fri, Nov 23, 2012 at 11:12 AM, Michael Herrmann
> <michael.herrmann at <mailto:michael.herrmann at>>
> 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
>     ( 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'?

I agree.

Terry Jan Reedy

More information about the Python-list mailing list