You can use a generator expression:
tuple(i for i in (1, 2, 3))
but parentheses were already taken for … generator expressions.
Related Posts:
- Why is there no tuple comprehension in Python?
- What are “named tuples” in Python?
- django: TypeError: ‘tuple’ object is not callable
- if/else in a list comprehension
- if/else in a list comprehension
- if else in a list comprehension
- Python convert tuple to string
- if else in a list comprehension
- Convert list to tuple in Python
- How to find all occurrences of an element in a list
- List comprehension on a nested list?
- How to get the union of two lists using list comprehension?
- Python add item to the tuple
- Python: tuple indices must be integers, not str when selecting from mysql table
- Creating a dictionary from a csv file?
- How to sort a list/tuple of lists/tuples by the element at a given index?
- Append a tuple to a list – what’s the difference between two ways?
- Add Variables to Tuple
- What’s the difference between lists enclosed by square brackets and parentheses in Python?
- How does tuple comparison work in Python?
- Inline for loop
- Python Set Comprehension
- Is it possible to use ‘else’ in a list comprehension?
- TypeError: can only concatenate tuple (not “str”) to tuple Error
- creating sets of tuples in python
- TypeError: can only concatenate tuple (not “int”) in Python
- Can I put a tuple into an array in python?
- Python convert tuple to string
- Does Python have an immutable list?
- How to create a GUID/UUID in Python
- Replace ‘ with \’ in a string
- How can I install pip on Windows?
- Best way to convert string to bytes in Python 3?
- Does Python have a string ‘contains’ substring method?
- Difference between import numpy and import numpy as np
- No module named ‘sklearn.cross_validation’
- Maximum and Minimum values for ints
- How do I copy a file in Python?
- EOFError: Ran out of input
- Get Color Palettes from ColorHunt.co in Python
- What does the Pydoc module do?
- size of NumPy array
- Best way to strip punctuation from a string
- How can I explicitly free memory in Python?
- filename.whl is not supported wheel on this platform
- What is the meaning of [:] in python [duplicate]
- Finding and replacing elements in a list
- socket.error: [Errno 48] Address already in use
- No module named MySQLdb
- Cannot convert list to array: ValueError: only one element tensors can be converted to Python scalars
- How do I plot only a table in Matplotlib?
- Change column type in pandas
- Split by comma and strip whitespace in Python
- How to remove punctuation marks from a string in Python 3.x using .translate()?
- Calculating Covariance with Python and Numpy
- What is the easiest way to remove all packages installed by pip?
- In practice, what are the main uses for the new “yield from” syntax in Python 3.3?
- Subplot for seaborn boxplot
- Dump a NumPy array into a csv file
- How to delete a character from a string using Python
- Finding all possible permutations of a given string in python
- Exit while loop in Python
- How do I check if a list is empty?
- IndexError: list index out of range and python
- Don’t understand why UnboundLocalError occurs (closure) [duplicate]
- OSError – Errno 13 Permission denied
- ImportError: No module named ‘Queue’
- ImportError: No Module Named bs4 (BeautifulSoup)
- How to calculate rolling / moving average using python + NumPy / SciPy?
- Defining lists as global variables in Python
- How to stop Python closing immediately when executed in Microsoft Windows
- Error: “dictionary update sequence element #0 has length 1; 2 is required” on Django 1.4
- module has no attribute
- How to print number with commas as thousands separators?
- double for loops in python
- Convert hex string to int in Python
- Function to close the window in Tkinter
- Is there a way to specify which pytest tests to run from a file?
- ImportError: No module named cv2
- ./xx.py: line 1: import: command not found
- How do I run pip on python for windows?
- How do I rotate an image around its center using Pygame?
- How can I copy a Python string?
- Issue with virtualenv – cannot activate
- Can I set max_retries for requests.request?
- Why do I get this error “TypeError: ‘method’ object is not iterable”?
- How to obfuscate Python code effectively?
- Controlling mouse with Python
- Are nested try/except blocks in Python a good programming practice?
- Getting a name error when trying to input a string [duplicate]
- Complex number troubles with numpy
- Running shell command and capturing the output
- Determine if 2 lists have the same elements, regardless of order? [duplicate]
- Python copy files to a new directory and rename if file name already exists
- Python 3 integer division [duplicate]
- numpy/scipy/ipython:Failed to interpret file as a pickle
- What is the Python equivalent of static variables inside a function?
- Python – difference between two strings
- Flask-framework: MVC pattern
- Installing win32gui python module