2.2 features

Duncan Booth duncan at NOSPAMrcp.co.uk
Thu Jul 26 12:44:05 CEST 2001


"Nick Perkins" <nperkins7 at home.com> wrote in 
news:l_P77.559300$eK2.117135519 at news4.rdc1.on.home.com:

> assert type(num) is int
> assert type(msg) is str
> 
> ( I assume the use of 'is', rather than '==',  is acceptable here )
> 
> ..much prettier.
> 
Prettier, but now you can subclass builtin types you may want isinstance 
instead:
    assert isinstance(collection, dictionary)

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list