Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
c5d3d4e7
Commit
c5d3d4e7
authored
4 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
deprecated DictionaryView
parent
d3939f31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-1
1 addition, 1 deletion
CHANGELOG.md
satella/__init__.py
+1
-1
1 addition, 1 deletion
satella/__init__.py
satella/coding/structures/dictionaries/objects.py
+8
-0
8 additions, 0 deletions
satella/coding/structures/dictionaries/objects.py
with
10 additions
and
2 deletions
CHANGELOG.md
+
1
−
1
View file @
c5d3d4e7
# v2.14.22
*
renamed
`current_severity_level`
to
`severity_level`
in
`MemoryPressureManager`
*
deprecated
`DictionaryView`
This diff is collapsed.
Click to expand it.
satella/__init__.py
+
1
−
1
View file @
c5d3d4e7
__version__
=
'
2.14.22_a
2
'
__version__
=
'
2.14.22_a
3
'
This diff is collapsed.
Click to expand it.
satella/coding/structures/dictionaries/objects.py
+
8
−
0
View file @
c5d3d4e7
import
copy
import
typing
as
tp
import
warnings
from
satella.coding.typing
import
K
,
V
...
...
@@ -212,6 +213,11 @@ class DictionaryView(tp.MutableMapping[K, V]):
>>>
del
dv
[
1
]
>>>
assertRaises
(
KeyError
,
lambda
:
dv
.
__delitem__
(
1
))
.. deprecated:: 2.14.22
Use ChainMap_ instead.
.. _ChainMap: https://docs.python.org/3/library/collections.html#collections.ChainMap
:param master_dict: First dictionary to look up. Entries made via __setitem__ will be put here.
:param rest_of_dicts: Remaining dictionaries
:param propagate_deletes: Whether to delete given key from the first dictionary that it is
...
...
@@ -232,6 +238,8 @@ class DictionaryView(tp.MutableMapping[K, V]):
def
__init__
(
self
,
master_dict
:
tp
.
Dict
[
K
,
V
],
*
rest_of_dicts
:
tp
.
Dict
[
K
,
V
],
propagate_deletes
:
bool
=
True
,
assign_to_same_dict
:
bool
=
True
):
warnings
.
warn
(
'
This is deprecated and will be removed in Satella 3.0.
'
'
Use collections.ChainMap instead
'
,
DeprecationWarning
)
self
.
assign_to_same_dict
=
assign_to_same_dict
self
.
master_dict
=
master_dict
self
.
dictionaries
=
[
master_dict
,
*
rest_of_dicts
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment