A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2001-March/013344.html below:

d = {}; d[0:1] = 1; d[0:1] = 2; print d[:]

[Python-Dev] Re: d = {}; d[0:1] = 1; d[0:1] = 2; print d[:] [Python-Dev] Re: d = {}; d[0:1] = 1; d[0:1] = 2; print d[:]Guido van Rossum guido@digicool.com
Thu, 01 Mar 2001 15:32:37 -0500
> >>>>> "RT" == Robin Thomas <robin.thomas@starmedia.net> writes:
> 
>   RT> Using Python 2.0 on Win32. Am I the only person to be depressed
>   RT> by the following behavior now that __getitem__ does the work of
>   RT> __getslice__?

Jeremy:
> You may the only person to have tried it :-).
> 
>   RT> Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
>   >>> d = {}
>   >>> d[0:1] = 1
>   >>> d
>   {slice(0, 1, None): 1}
> 
> I think this should raise a TypeError (as you suggested later).

Me too, but it's such an unusual corner-case that I can't worry about
it too much.  The problem has to do with being backwards compatible --
we couldn't add the 3rd argument to the slice API that we wanted.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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