File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -510,14 +510,18 @@ Dictionary objects
510510.. c :function :: PyObject* PyDict_AsFrozenDictAndClear (PyObject *dict)
511511
512512 Return a new :class: `frozendict ` created
513- from the existing :c:type: ` PyDictObject ` instance.
513+ from the existing :class: ` dict ` instance.
514514 Expects *dict * to be an exact :class: `dict ` instance.
515515
516516 Transfers all keys and values from *dict *
517- to the newly allocated :class: `!frozendict ` with O(1) complexity .
517+ to the newly allocated :class: `!frozendict `.
518518 Clears the input *dict * on success.
519519 Returns ``NULL `` with the exception set on error.
520520
521+ .. impl-detail ::
522+
523+ Works with O(1) complexity.
524+
521525 .. versionadded:: next
522526
523527
Original file line number Diff line number Diff line change @@ -611,18 +611,18 @@ def test_dict_popstring(self):
611611
612612 def test_dict_as_frozendict_and_clear (self ):
613613 # Test PyDict_AsFrozenDictAndClear()
614- check = _testcapi .dict_as_frozendict_and_clear
614+ as_frozendict = _testcapi .dict_as_frozendict_and_clear
615615 d = {1 : 2 , 'a' : 'b' }
616- f = check (d )
616+ f = as_frozendict (d )
617617 self .assertIs (type (f ), frozendict )
618618 self .assertEqual (f , frozendict ({1 : 2 , 'a' : 'b' }))
619619 self .assertIs (type (d ), dict )
620620 self .assertEqual (d , {})
621621
622622 d = {}
623- f = check (d )
623+ f = as_frozendict (d )
624624 self .assertIs (type (f ), frozendict )
625- self .assertEqual (f , {} )
625+ self .assertEqual (f , frozendict () )
626626 self .assertIs (type (d ), dict )
627627 self .assertEqual (d , {})
628628 # CRASHES check([])
You can’t perform that action at this time.
0 commit comments