A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/299487.html below:

Question about consistency in python language

Question about consistency in python language Question about consistency in python languagelechequier at gmail.com lechequier at gmail.com
Thu Sep 8 19:03:12 EDT 2005
Let's say I define a list of pairs as follows:
>>l = [('d', 3), ('a', 2), ('b', 1)]

Can anyone explain why this does not work?
>>h = {}.update(l)

and instead I have to go:
>>h = {}
>>h.update(l)
to initialize a dictionary with the given list of pairs?

when an analagous operation on strings works fine:
>>s = "".join(["d","o","g"])

Seems inconsistent. 

thanks,
Scott


More information about the Python-list 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