diff options
| author | Xavier Morel <xmo@odoo.com> | 2017-04-11 16:57:18 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2017-04-11 17:04:45 +0200 |
| commit | 578b0ef2fd407201ad1181a64ee0984b3480a4fa (patch) | |
| tree | 99360ef000a6bb9e38f82f79ff3bbc8478cfbebb /doc/python3.rst | |
| parent | 3f20662b3ef287f2eb281b08da3993c25026841d (diff) | |
[#8530] convert dict.has_key
Redundant with `in` and removed from Python 3.
Removed odd, old and long-unused UpdatableDict (which defines and uses
has_key) and UpdatableStr (which was nearby and caught in the blast),
validated with al.
(lib2to3.fixes.fix_has_key)
Diffstat (limited to 'doc/python3.rst')
| -rw-r--r-- | doc/python3.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/python3.rst b/doc/python3.rst index 55047f16d4b..b339e0a98b0 100644 --- a/doc/python3.rst +++ b/doc/python3.rst @@ -98,3 +98,14 @@ Removed Operators These two operators were long recommended against/deprecated in Python 2, Python 3 removed them from the language. + +Removed/renamed methods +----------------------- + +.. important:: + + * the ``has_key`` method on dicts must be replaced by use of the ``in`` + operator e.g. ``foo.has_key(bar)`` becomes ``bar in foo``. + +``in`` for dicts was introduced in Python 2.3, leading to ``has_key`` being +redundant, and removed in Python 3. |
