@@ -4140,6 +4140,12 @@ The constructors for both classes work the same:
41404140 objects. If *iterable * is not specified, a new empty set is
41414141 returned.
41424142
4143+ Sets can be created by several means:
4144+
4145+ * Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'} ``
4146+ * Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'} ``
4147+ * Use the type constructor: ``set() ``, ``set('foobar') ``, ``set(['a', 'b', 'foo']) ``
4148+
41434149 Instances of :class: `set ` and :class: `frozenset ` provide the following
41444150 operations:
41454151
@@ -4332,6 +4338,14 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
43324338 Return a new dictionary initialized from an optional positional argument
43334339 and a possibly empty set of keyword arguments.
43344340
4341+ Dictionaries can be created by several means:
4342+
4343+ * Use a comma-separated list of ``key: value `` pairs within braces:
4344+ ``{'jack': 4098, 'sjoerd': 4127} `` or ``{4098: 'jack', 4127: 'sjoerd'} ``
4345+ * Use a dict comprehension: ``{} ``, ``{x: x ** 2 for x in range(10)} ``
4346+ * Use the type constructor: ``dict() ``,
4347+ ``dict([('foo', 100), ('bar', 200)]) ``, ``dict(foo=100, bar=200) ``
4348+
43354349 If no positional argument is given, an empty dictionary is created.
43364350 If a positional argument is given and it is a mapping object, a dictionary
43374351 is created with the same key-value pairs as the mapping object. Otherwise,
0 commit comments