> As with all micro-optimizations, the win usually only shows > up in some applications. The one I'm writing uses lot's of > > if tagtype == 'starttag': > if tagtype == 'endtag': > ... > > Since the 'starttag' and 'endtag' strings are interned and > I'm also interning the strings which are stored in tagtype, > I'd like to benefit from the fact that the compare will actually > work as 'is'-compare. However, I don't want to use 'is' because > I consider interning only an optimization and not a feature > of the language. Agreed. > That's why I would like the simple > > if (v == w) return 0; > > integrated into the ceval loop right along the INT-compare > optimization. Maybe this could be done as follows: if (v == w && PyString_CheckExact(v)) return 0; > This may also help in some other situations where objects are > shared. Now *that* is the speculation for which Tim will chop off your head. :-) --Guido van Rossum (home page: http://www.python.org/~guido/)
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