This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mikesiegel
Recipients mikesiegel
Date 2021-02-09.16:02:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612886537.53.0.750473306106.issue43180@roundup.psfhosted.org>
In-reply-to
Content
Perhaps I'm missing something here but this behavior seems unexpected to me. "Lists

    The items of a list are arbitrary Python objects. Lists are formed by placing a *comma-separated* list of expressions in square brackets. (Note that there are no special cases needed to form lists of length 0 or 1.)"

>>> import sys
>>> print(sys.version)
3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0]
>>> test = [ "foo" "bar" ]
>>> type(test)
<class 'list'>
>>> print(test)
['foobar']
>>> import json
>>> json.dumps({ "foo": test })
'{"foo": ["foobar"]}'
>>>

In a complex dict structure this is an easy way to shoot yourself in the foot.
History
Date User Action Args
2021-02-09 16:02:17mikesiegelsetrecipients: + mikesiegel
2021-02-09 16:02:17mikesiegelsetmessageid: <1612886537.53.0.750473306106.issue43180@roundup.psfhosted.org>
2021-02-09 16:02:17mikesiegellinkissue43180 messages
2021-02-09 16:02:16mikesiegelcreate