Stream: helpdesk (published)

Topic: ✔ Is it possible to create an empty tuple?


view this post on Zulip Júlio Hoffimann (Jul 22 2023 at 15:07):

Is there a workaround to define an empty tuple like (,)?

This SO entry explains it is not possible: https://stackoverflow.com/a/73758150/2539623

view this post on Zulip Mason Protter (Jul 22 2023 at 15:08):

You just write ().

view this post on Zulip Mason Protter (Jul 22 2023 at 15:09):

That SO post is about how you cant make an empty tuple with a specific element type (because it has no elements)

view this post on Zulip Júlio Hoffimann (Jul 22 2023 at 15:18):

Thank you @Mason Protter !

view this post on Zulip Notification Bot (Jul 22 2023 at 15:18):

Júlio Hoffimann has marked this topic as resolved.

view this post on Zulip Mason Protter (Jul 22 2023 at 15:41):

I always found it dumb that (,) didnt work.

view this post on Zulip ederag (Jul 22 2023 at 18:32):

tuple() produces an empty tuple too.


Last updated: Oct 02 2023 at 04:34 UTC