Follow

Things I love about Python

You can use comma after last item in declaration. This comma is just ignored. What is the bonus? You don't have to focus on not adding comma while generating some data from text file.

My usecase:
Just parsing with awk emulating Python list and pasting into Python shell)

When is that really usefull? For definition of single item tuple, try this:
>>> type((1))
<class 'int'>
>>> type((1, ))
<class 'tuple'>

Sign in to participate in the conversation
mastodon.cloud

Generalistic and moderated instance.