Vladimir> I'll repeat myself: >>>> wink Vladimir> <wink object at 80c5f30> >>>> wink.fraction = 1e+-1 >>>> wink.fraction.precision = 1e-+1 >>>> wink.compute() Vladimir> 0.0 Vladimir> Has anybody noticed that 'fraction' is a float I wanted to Vladimir> qualify with a 'precision' attribute? Quick comment before I rush home... There is a significant cost to be had by adding attributes to numbers (ints at least). They can no longer be shared in the int cache. I think the runtime size increase would be pretty huge, as would the extra overhead in creating all those actual (small) IntObjects instead of sharing a single copy. On the other hand, functions are already pretty heavyweight objects and occur much less frequently than numbers in common Python programs. They aren't shared (except for instance methods, which Barry's patch already excludes), so there's no risk of stomping on attributes that are shared by more than one function. -- Skip Montanaro | http://www.mojam.com/ skip@mojam.com | http://www.musi-cal.com/
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