Re:Pycraft: Minecraft engine in Python
by rnhmjoj on Tuesday April 19, 2016 @02:15AM
(#11525187)
In python 3 range() does not build a list but produce a range object. Testing x in range(a,b) will actually call the __contains__ method of the object which is O(1).
The only overhead here may be the object creation.
See this http://stackoverflow.com/q/30081275
[ Parent
| on HN ]