You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on https://github.com/slezica/python-frozendict and https://github.com/mredolatti/python-frozendict .
145
-
146
-
Copyright (c) 2012 Santiago Lezica
147
-
148
-
Licensed under the MIT License:
147
+
|Based on https://github.com/slezica/python-frozendict and https://github.com/mredolatti/python-frozendict .
148
+
|Copyright (c) 2012 Santiago Lezica
149
+
|Licensed under the MIT License:
149
150
150
151
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
151
152
152
153
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
153
154
154
155
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
155
156
156
-
|
157
-
158
-
Also based on https://github.com/Marco-Sulla/python-frozendict
159
-
160
-
Copyright (c) Marco Sulla
161
-
162
-
Licensed under the `GNU Lesser General Public License Version 3 <https://www.gnu.org/licenses/lgpl-3.0.en.html>`_
157
+
|Also based on https://github.com/Marco-Sulla/python-frozendict
158
+
|Copyright (c) Marco Sulla
159
+
|Licensed under the `GNU Lesser General Public License Version 3 <https://www.gnu.org/licenses/lgpl-3.0.en.html>`_
Copy file name to clipboardExpand all lines: doc-source/classes/frozenordereddict.rst
+22-28Lines changed: 22 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,67 +5,61 @@ FrozenOrderedDict
5
5
About
6
6
========
7
7
8
-
:class:`~cawdrey.frozenordereddict.FrozenOrderedDict` is a immutable wrapper around an OrderedDict.
8
+
:class:`~cawdrey.FrozenOrderedDict` is a immutable wrapper around an OrderedDict.
9
9
10
-
:class:`~cawdrey.frozenordereddict.FrozenOrderedDict` is similar to ``frozendict``, and with regards to immutability it
10
+
:class:`~cawdrey.FrozenOrderedDict` is similar to :class:`~cawdrey.frozendict`, and with regards to immutability it
11
11
solves the same problems:
12
12
13
13
- Because dictionaries are mutable, they are not hashable and cannot be used in sets or as dictionary keys.
14
14
- Nasty bugs can and do occur when mutable data structures are passed around.
15
15
16
16
It can be initialized just like a :class:`~python:dict` or :class:`~python:collections.OrderedDict`.
17
-
Once instantiated, an instance of :class:`~cawdrey.frozenordereddict.FrozenOrderedDict` cannot be altered,
18
-
since it does not implement the ``MutableMapping`` interface.
17
+
Once instantiated, an instance of :class:`~cawdrey.FrozenOrderedDict` cannot be altered,
18
+
since it does not implement the :class:`~collections.abc.MutableMapping` interface.
19
19
20
-
It does implement the ``Mapping`` interface, so can be used just like a
20
+
It does implement the :class:`~collections.abc.Mapping` interface, so can be used just like a
21
21
normal dictionary in most cases.
22
22
23
-
In order to modify the contents of a :class:`~cawdrey.frozenordereddict.FrozenOrderedDict`, a new
23
+
In order to modify the contents of a :class:`~cawdrey.FrozenOrderedDict`, a new
24
24
instance must be created. The easiest way to do that is by
25
25
calling the `.copy()` method. It will return a new instance of
26
-
:class:`~cawdrey.frozenordereddict.FrozenOrderedDict` initialized using the following steps:
26
+
:class:`~cawdrey.FrozenOrderedDict` initialized using the following steps:
27
27
28
-
1. A copy of the wrapped OrderedDict instance will be created.
29
-
2. If any arguments or keyword arguments are passed to the `.copy()` method, they will be used to create another OrderedDict instance, which will then be used to update the copy made in step #1.
28
+
1. A copy of the wrapped :class:`~python:collections.OrderedDict` instance will be created.
29
+
2. If any arguments or keyword arguments are passed to the `.copy()` method, they will be used to create another :class:`~python:collections.OrderedDict` instance, which will then be used to update the copy made in step #1.
30
30
3. Finally, `self.__class__()` will be called, passing the copy as the only argument.
Based on https://github.com/slezica/python-frozendict and https://github.com/mredolatti/python-frozendict .
44
-
45
-
Copyright (c) 2012 Santiago Lezica
46
-
47
-
Licensed under the MIT License:
46
+
|Based on https://github.com/slezica/python-frozendict and https://github.com/mredolatti/python-frozendict .
47
+
|Copyright (c) 2012 Santiago Lezica
48
+
|Licensed under the MIT License:
48
49
49
50
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
50
51
51
52
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
52
53
53
54
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
54
55
55
-
|
56
-
57
-
Also based on
58
-
https://github.com/Marco-Sulla/python-frozendict
59
-
Copyright (c) Marco Sulla
60
-
Licensed under the `GNU Lesser General Public License Version 3 <https://www.gnu.org/licenses/lgpl-3.0.en.html>`_
61
-
62
-
|
63
-
64
-
Also based on https://github.com/wsmith323/frozenordereddict
65
-
66
-
Copyright (c) 2015 Warren Smith
56
+
|Also based on https://github.com/Marco-Sulla/python-frozendict
57
+
|Copyright (c) Marco Sulla
58
+
|Licensed under the `GNU Lesser General Public License Version 3 <https://www.gnu.org/licenses/lgpl-3.0.en.html>`_
67
59
68
-
Licensed under the MIT License:
60
+
|Also based on https://github.com/wsmith323/frozenordereddict
61
+
|Copyright (c) 2015 Warren Smith
62
+
|Licensed under the MIT License:
69
63
70
64
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
0 commit comments