[#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)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user