gh-105096: Reformat wave documentation (#105136)

Add ".. class::" markups in the wave documentation.

* Reformat also wave.py (minor PEP 8 changes).
* Remove redundant "import struct": it's already imported at top
  level.
* Remove wave.rst from .nitignore
This commit is contained in:
Victor Stinner 2023-05-31 13:29:10 +02:00 committed by GitHub
parent 579c41c102
commit 85e5d03163
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 136 additions and 129 deletions

View file

@ -92,6 +92,7 @@ _array_fmts = None, 'b', 'h', None, 'i'
_wave_params = namedtuple('_wave_params',
'nchannels sampwidth framerate nframes comptype compname')
def _byteswap(data, width):
swapped_data = bytearray(len(data))
@ -104,7 +105,6 @@ def _byteswap(data, width):
class _Chunk:
def __init__(self, file, align=True, bigendian=True, inclheader=False):
import struct
self.closed = False
self.align = align # whether to align to word (2-byte) boundaries
if bigendian:
@ -214,7 +214,6 @@ class _Chunk:
raise EOFError
class Wave_read:
"""Variables used in this class:
@ -411,6 +410,7 @@ class Wave_read:
self._comptype = 'NONE'
self._compname = 'not compressed'
class Wave_write:
"""Variables used in this class:
@ -638,6 +638,7 @@ class Wave_write:
self._file.seek(curpos, 0)
self._datalength = self._datawritten
def open(f, mode=None):
if mode is None:
if hasattr(f, 'mode'):