You can use a generator expression:
tuple(i for i in (1, 2, 3))
but parentheses were already taken for … generator expressions.
More Related Contents:
- Create a dictionary with comprehension
- How to unzip a list of tuples into individual lists? [duplicate]
- Is it possible to access current object while doing list/dict comprehension in Python?
- Nested dictionary comprehension python
- How do I convert a tuple of tuples to a one-dimensional list using list comprehension? [duplicate]
- Find partial tuple in list of tuple
- What is the syntax rule for having trailing commas in tuple definitions?
- Understanding nested list comprehension
- Are tuples more efficient than lists in Python?
- How can I split a column of tuples in a Pandas dataframe?
- a mutable type inside an immutable container
- What is the pythonic way to unpack tuples? [duplicate]
- What is the advantage of a list comprehension over a for loop?
- list() uses slightly more memory than list comprehension
- How to recursively find specific key in nested JSON?
- List comprehension and lambdas in Python [duplicate]
- Python element-wise tuple operations like sum
- Converting a list of tuples into a dict
- How is tuple implemented in CPython?
- Find an element in a list of tuples
- Why is one class variable not defined in list comprehension but another is?
- How to convert list of tuples to multiple lists?
- Change values in dict of nested dicts using items in a list?
- Why do we need tuples in Python (or any immutable data type)?
- What does *tuple and **dict mean in Python? [duplicate]
- Why does adding a trailing comma after an expression create a tuple?
- Python list comprehension – want to avoid repeated evaluation
- Name is not defined in a list comprehension with multiple loops
- Why do list comprehensions write to the loop variable, but generators don’t? [duplicate]
- Sort a list of tuples depending on two elements [duplicate]