Language Delimiters

{ — left brace

Opens a dictionary or set display or comprehension; in an f-string it can introduce a replacement field. An empty brace display creates a dictionary, not a set.

Formal Syntax & Structure

python syntaxpython
{

Return Value

Not applicable

Grammar token; the enclosing construct determines any result.

Working Example

Example Snippetpython
print(type({}).__name__, len({1, 2, 1}))
Python Reference