Tim Peters wrote: > [Andrew Koenig] > >>... and I wouldn't mind it if there were a way of testing for >>substitutability that were as easy to spell as "is" -- in fact, I >>wouldn't mind if it were spelled "is" even though I realize it's >>probably impractical to do so. > > > It's definitely impractical to do so in the 2.3 line. Looking beyond that, > I'm not sure we have real use cases for substitutability. It seemed to boil > down to: > > x substitutable y = > x is y if x is mutable, or a mutable object is reachable > from x, or y is mutable, or a mutable object is > reachable from y > x == y otherwise (x and y are immutable, and only immutable > objects are reachable from them) As I understood it, 'b' and 'c' are supposed to be substitutable in the following example, since 'b' and 'c' will have the same value even after 'a' changes: a = [] b = (a,) c = (a,) Shane
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