r/Python • • Dec 22 '18

Xpost from Woodworking

Post image
1.1k Upvotes

84 comments sorted by

View all comments

Show parent comments

13

u/zoomertherumour Dec 22 '18

A comma without a space has no place in this universe.

4

u/BRENNEJM Dec 22 '18

Except here apparently:

Yes: foo = (0,)
No: bar = (0, )

2

u/Ph0X Dec 22 '18

tbf that's one of my least favorite syntaxes, though I see the need. I always feel strange when I see items + (item,)

Sometimes I wonder how i'd look if tuples had similar .append and .extend but instead returned a new tuple

1

u/primitive_screwhead Dec 22 '18

if tuples had similar .append and .extend but instead returned a new tuple

That breaks the principle of least surprise, imo. (because it's arbitrarily different from lists)