10 sec poll - please reply!

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Nov 21 02:20:15 CET 2012


On Tue, 20 Nov 2012 21:08:24 +0000, Prasad, Ramit wrote:

>> I believe that your initial instinct for the name of this function was
>> correct. It automates typing, so you should call it "type" or (for
>> those paranoid about shadowing the built-in, "type_str".
>> 
>> 
> I can too easily see somebody doing from module import * OR from module
> import type.

Yes. So what? If they do, then either they intended to do it, or they 
will soon learn not to.

*Accidental* shadowing of names is a bad thing, because you get 
unexpected bugs. *Deliberate* shadowing is not. We're all consenting 
adults here, if somebody calls "from module import type", and shadows the 
builtin type, that's their right to shoot themselves in the foot. Or not, 
as the case may be.


-- 
Steven


More information about the Python-list mailing list