isinstance() necessary and helpful, sometimes

Jason Orendorff jason at jorendorff.com
Fri Jan 25 12:02:07 EST 2002


> However, there IS an approach that is even better, and we have
> just finished talking about it: *potentially idempotent adapting
> functions*!  re.compile just happens to be one of those, thanks be:
> 
> >>> a=re.compile(r'\d+')
> >>> b=re.compile(a)
> >>> a is b
> 1

This is not a documented feature.

## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list