Skip to content

Commit

Permalink
pythongh-105096: Deprecate wave getmarkers() method
Browse files Browse the repository at this point in the history
Deprecate the getmark(), setmark() and getmarkers() methods of the
Wave_read and Wave_write classes of the wave module.
  • Loading branch information
vstinner committed May 30, 2023
1 parent b7aadb4 commit 8121bb2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Doc/library/wave.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,19 @@ module, and don't do anything interesting.

Returns ``None``.

.. deprecated-removed:: 3.11 3.13
The method only existed for compatibility with the :mod:`!aifc` module
which has been removed in Python 3.13.


.. method:: Wave_read.getmark(id)

Raise an error.

.. deprecated-removed:: 3.11 3.13
The method only existed for compatibility with the :mod:`!aifc` module
which has been removed in Python 3.13.

The following two methods define a term "position" which is compatible between
them, and is otherwise implementation dependent.

Expand Down
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ Optimizations
Deprecated
==========

* :mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()``
methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes.
(Contributed by Victor Stinner in :gh:`105096`.)


Removed
Expand Down
10 changes: 10 additions & 0 deletions Lib/wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,13 @@ def getparams(self):
self.getcomptype(), self.getcompname())

def getmarkers(self):
import warnings
warnings._deprecated("Wave_read.getmarkers", remove=(3, 15))
return None

def getmark(self, id):
import warnings
warnings._deprecated("Wave_read.getmark", remove=(3, 15))
raise Error('no marks')

def setpos(self, pos):
Expand Down Expand Up @@ -548,12 +552,18 @@ def getparams(self):
self._nframes, self._comptype, self._compname)

def setmark(self, id, pos, name):
import warnings
warnings._deprecated("Wave_write.setmark", remove=(3, 15))
raise Error('setmark() not supported')

def getmark(self, id):
import warnings
warnings._deprecated("Wave_write.getmark", remove=(3, 15))
raise Error('no marks')

def getmarkers(self):
import warnings
warnings._deprecated("Wave_write.getmarkers", remove=(3, 15))
return None

def tell(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()``
methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes.
Patch by Victor Stinner.

0 comments on commit 8121bb2

Please sign in to comment.