raymond wrote: > There were a couple of threads on comp.lang.py with headings like > "isinstance considered harmful". The conclusion was that most cases = should > have been coded some other way. The legitimate uses included = implementing > multiple dispatch (supporting calls with type differentiated = signatures) , > factory functions, decorator pattern (which needs to know if the = object was > previously decorated), and the composite pattern (which needs to know = if it > is dealing with an atom or a composite). since when is comp.lang.py is an authority on anything? > Here are some of the ideas for conversion: >=20 > if type(x) is int --> if x=3D=3Dint(x) # 3L would be passable are these supposed to be equivalent, for any kind of x? what Python version are you using? </F>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4