M.-A. Lemburg wrote: > A nice side-effect would be that could easily use the > same approach to replace the often used default-argument-hack, > e.g. > > def fraction(x, int=int, float=float): > return float(x) - int(x) > > This would then read: > > def fraction(x): > const int, float > return float(x) - int(x) There's a certain risk that the premature-optimization fraction will plaster every function with const declarations, but they write unreadable code anyway ;) Aside from this, there's still another point: assume you have quite a number of module-level string "constants" which you want to use in a switch. You'd have to repeat all of their names in a "const" declaration in order to use them this way. Georg
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