What is a function parameter =[] for?

Ian Kelly ian.g.kelly at gmail.com
Wed Nov 25 21:46:52 EST 2015


On Wed, Nov 25, 2015 at 7:25 PM, Chris Angelico <rosuav at gmail.com> wrote:
> On Thu, Nov 26, 2015 at 1:08 PM, Alan Bawden <alan at csail.mit.edu> wrote:
>> (Note that nothing in the documentation I can find actually _guarantees_
>> that a Python implementation will only have one unique empty tuple, but
>> I wouldn't be suprised if the following is nonetheless true in all
>> current implementations:
>>
>>    >>> tuple([]) is tuple([])
>>    True
>>
>> )
>
> Jython 2.5.3 (, Oct 8 2014, 03:39:09)
> [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_85
> Type "help", "copyright", "credits" or "license" for more information.
>>>> tuple([]) is tuple([])
> False
>
> Python 2.7.8 (2.4.0+dfsg-3, Dec 20 2014, 13:30:46)
> [PyPy 2.4.0 with GCC 4.9.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>>> tuple([]) is tuple([])
> False

Well, he did say all "current" implementations. CPython 2.7 may still
be supported, but that doesn't make it current. And anything at 2.5 is
just archaic.



More information about the Python-list mailing list