On Wednesday 29 May 2002 07:28 pm, Raymond Hettinger wrote: ... > strings. That way, we can get O(1) behavior instead of O(n) behavior for > code like: if c in str.printable: c='*'. If someone needs to know the > contents, they can run str.printable.keys(). Also, because the dictionary > is mutable, someone can (at runtime) expand or contract the definitions: > str.whitespace.append('_'). append would of course not work on a dictionary, but the prospect of allowing easy mutation of fundamental built-ins is quite negative in Python -- goes against the grain of the language. A read-only dictionary might be OK. Alex
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