|
2 | 2 |
|
3 | 3 | .. _dictobjects: |
4 | 4 |
|
5 | | -Dictionary Objects |
| 5 | +Dictionary objects |
6 | 6 | ------------------ |
7 | 7 |
|
8 | 8 | .. index:: pair: object; dictionary |
@@ -444,7 +444,7 @@ Dictionary Objects |
444 | 444 | .. versionadded:: 3.12 |
445 | 445 |
|
446 | 446 |
|
447 | | -Dictionary View Objects |
| 447 | +Dictionary view objects |
448 | 448 | ^^^^^^^^^^^^^^^^^^^^^^^ |
449 | 449 |
|
450 | 450 | .. c:function:: int PyDictViewSet_Check(PyObject *op) |
@@ -490,7 +490,58 @@ Dictionary View Objects |
490 | 490 | always succeeds. |
491 | 491 |
|
492 | 492 |
|
493 | | -Ordered Dictionaries |
| 493 | +Frozen dictionary objects |
| 494 | +^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 495 | +
|
| 496 | +.. versionadded:: next |
| 497 | +
|
| 498 | +
|
| 499 | +.. c:var:: PyTypeObject PyFrozenDict_Type |
| 500 | +
|
| 501 | + This instance of :c:type:`PyTypeObject` represents the Python frozen |
| 502 | + dictionary type. |
| 503 | + This is the same object as :class:`frozendict` in the Python layer. |
| 504 | +
|
| 505 | +
|
| 506 | +.. c:function:: int PyAnyDict_Check(PyObject *p) |
| 507 | +
|
| 508 | + Return true if *p* is a :class:`dict` object, a :class:`frozendict` object, |
| 509 | + or an instance of a subtype of the :class:`!dict` or :class:`!frozendict` |
| 510 | + type. |
| 511 | + This function always succeeds. |
| 512 | +
|
| 513 | +
|
| 514 | +.. c:function:: int PyAnyDict_CheckExact(PyObject *p) |
| 515 | +
|
| 516 | + Return true if *p* is a :class:`dict` object or a :class:`frozendict` object, |
| 517 | + but not an instance of a subtype of the :class:`!dict` or |
| 518 | + :class:`!frozendict` type. |
| 519 | + This function always succeeds. |
| 520 | +
|
| 521 | +
|
| 522 | +.. c:function:: int PyFrozenDict_Check(PyObject *p) |
| 523 | +
|
| 524 | + Return true if *p* is a :class:`frozendict` object or an instance of a |
| 525 | + subtype of the :class:`!frozendict` type. |
| 526 | + This function always succeeds. |
| 527 | +
|
| 528 | +
|
| 529 | +.. c:function:: int PyFrozenDict_CheckExact(PyObject *p) |
| 530 | +
|
| 531 | + Return true if *p* is a :class:`frozendict` object, but not an instance of a |
| 532 | + subtype of the :class:`!frozendict` type. |
| 533 | + This function always succeeds. |
| 534 | +
|
| 535 | +
|
| 536 | +.. c:function:: PyObject* PyFrozenDict_New(PyObject *iterable) |
| 537 | +
|
| 538 | + Return a new :class:`frozendict` from an iterable, or ``NULL`` on failure |
| 539 | + with an exception set. |
| 540 | +
|
| 541 | + Create an empty dictionary if *iterable* is ``NULL``. |
| 542 | +
|
| 543 | +
|
| 544 | +Ordered dictionaries |
494 | 545 | ^^^^^^^^^^^^^^^^^^^^ |
495 | 546 |
|
496 | 547 | Python's C API provides interface for :class:`collections.OrderedDict` from C. |
|
0 commit comments