mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.12] gh-105096: Reformat wave documentation (#105136) (#105138) 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 (cherry picked from commit85e5d03163) (cherry picked from commit01b42f9559)
This commit is contained in:
parent
67a8469237
commit
5de6ca59fb
2 changed files with 135 additions and 127 deletions
|
|
@ -89,6 +89,7 @@ class Error(Exception):
|
|||
_wave_params = namedtuple('_wave_params',
|
||||
'nchannels sampwidth framerate nframes comptype compname')
|
||||
|
||||
|
||||
def _byteswap(data, width):
|
||||
swapped_data = bytearray(len(data))
|
||||
|
||||
|
|
@ -101,7 +102,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:
|
||||
|
|
@ -211,7 +211,6 @@ def skip(self):
|
|||
raise EOFError
|
||||
|
||||
|
||||
|
||||
class Wave_read:
|
||||
"""Variables used in this class:
|
||||
|
||||
|
|
@ -393,6 +392,7 @@ def _read_fmt_chunk(self, chunk):
|
|||
self._comptype = 'NONE'
|
||||
self._compname = 'not compressed'
|
||||
|
||||
|
||||
class Wave_write:
|
||||
"""Variables used in this class:
|
||||
|
||||
|
|
@ -620,6 +620,7 @@ def _patchheader(self):
|
|||
self._file.seek(curpos, 0)
|
||||
self._datalength = self._datawritten
|
||||
|
||||
|
||||
def open(f, mode=None):
|
||||
if mode is None:
|
||||
if hasattr(f, 'mode'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue