Still the __new__ hell ...

Duncan Booth duncan.booth at invalid.invalid
Wed Mar 21 07:44:39 EDT 2007


Paulo da Silva <psdasilvaX at esotericaX.ptX> wrote:

> As a relatively inexperient
> in python, how could I know that a 'string' is an instance of
> basestring?

I think a good tip for anyone learning Python (or upgrading from an earlier 
version) is to do:

    dir(__builtins__)

at the interactive prompt and read through the list it produces working out 
what each builtin does. Some of them you can ignore(1), some you can file 
away as interesting to know they exist but you don't need to know the 
details today(2), and others are indispensible(3).

Do that and you'll find basestring (category 2 until you needed to ask your 
question) between apply (category 1) and bool (category 3).



More information about the Python-list mailing list