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

rusi rustompmody at gmail.com
Fri Nov 30 12:54:00 EST 2012


On Nov 23, 9:12 pm, Michael Herrmann <michael.herrm... 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.
>
> 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

Im entering this thread late (was off mail for a week), so pardon me
if someone has already said this -- but have you looked at the
difference between internal and external dsls:
http://martinfowler.com/bliki/DomainSpecificLanguage.html (and links
therein) ?

Roughly speaking if what you are making is an external dsl, then its
not really python (it may be python-inspired but thats not really
germane) and so reusing python lexemes/structures etc in ways not
exactly consistent with python usage should be no issue

If its an internal DSL, you are headed for causing/suffering grief.

I looked at your site [yes it looked almost interesting -- if only it
ran on linux :-( ] and I cant really decide whether to classify it as
external or internal



More information about the Python-list mailing list