Skip to content

Commit cf04eb9

Browse files
committed
Keep frozendict-only assertions behind the feature gate
Assisted-by: OpenAI Codex:model identifier unavailable
1 parent c95eb7b commit cf04eb9

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

‎extra_tests/snippets/builtin_dict.py‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,6 @@
2626
next(dict_reversed)
2727
assert "dict" in dict().__doc__
2828

29-
assert (
30-
frozendict.__doc__
31-
== """frozendict() -> new empty immutable dictionary
32-
frozendict(mapping) -> new immutable dictionary initialized from a mapping
33-
object's (key, value) pairs
34-
frozendict(iterable) -> new immutable dictionary initialized as if via:
35-
d = {}
36-
for k, v in iterable:
37-
d[k] = v
38-
d = frozendict(d)
39-
frozendict(**kwargs) -> new immutable dictionary initialized with the name=value
40-
pairs in the keyword argument list. For example: frozendict(one=1, two=2)"""
41-
)
4229

4330
d = {"a": 123, "b": 456}
4431
assert 1 not in d.items()
@@ -874,6 +861,20 @@ def __hash__(self):
874861
import builtins
875862

876863
if hasattr(builtins, "frozendict"):
864+
assert (
865+
frozendict.__doc__
866+
== """frozendict() -> new empty immutable dictionary
867+
frozendict(mapping) -> new immutable dictionary initialized from a mapping
868+
object's (key, value) pairs
869+
frozendict(iterable) -> new immutable dictionary initialized as if via:
870+
d = {}
871+
for k, v in iterable:
872+
d[k] = v
873+
d = frozendict(d)
874+
frozendict(**kwargs) -> new immutable dictionary initialized with the name=value
875+
pairs in the keyword argument list. For example: frozendict(one=1, two=2)"""
876+
)
877+
877878
import builtins
878879
import copy
879880
import gc

0 commit comments

Comments
 (0)