A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-March/043429.html below:

[Python-Dev] redefining is

[Python-Dev] redefining isShane Hathaway shane at zope.com
Tue Mar 23 17:18:37 EST 2004
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

More information about the Python-Dev mailing list

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