Changes by Claudiu Popa pcmantic...@gmail.com:
--
stage: patch review - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
___
Roundup Robot added the comment:
New changeset ef72142eb8a2 by R David Murray in branch 'default':
#18615: Make sndhdr return namedtuples.
https://hg.python.org/cpython/rev/ef72142eb8a2
--
nosy: +python-dev
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
Committed. Thanks, Claudiu.
--
resolution: - fixed
stage: commit review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
Claudiu Popa added the comment:
Serhiy, is there anything left to do for this patch?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
Raymond Hettinger added the comment:
The patch looks good. I'll apply it shortly.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
___
Serhiy Storchaka added the comment:
The documentation says:
When these functions are able to determine
what type of sound data is stored in a file,
they return a :func:`~collections.namedtuple`, containing five attributes:
(``type``, ``sampling_rate``, ``channels``,
``frames``,
Claudiu Popa added the comment:
Thanks.
--
Added file: http://bugs.python.org/file36290/issue18615_2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
Claudiu Popa added the comment:
Serhiy, if there's no actual gain in changing this, should we close the issue?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
Raymond Hettinger added the comment:
This is a reasonable improvement. It was what named tuples were intended to be
used for.
--
assignee: - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
Serhiy Storchaka added the comment:
If Raymond found this feature helpful, I have no strong objection.
Only several comments:
* A named tuple is documented as having fields: type, sampling_rate, channels,
frames, bits_per_sample.
* User tests in existing code return tuples. what() and
Claudiu Popa added the comment:
Thanks, Serhiy, for the review. Here's the updated version.
--
Added file: http://bugs.python.org/file35956/issue18615.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
Serhiy Storchaka added the comment:
A namedtuple is still wrongly documented.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
___
Claudiu Popa added the comment:
Here's a new version. It adds versionchanged directive for 'whathdr' and
'what'. Serhiy, I hope that now I got right the documentation of the return
type. I didn't understand at first what was wrong.
--
Added file:
Serhiy Storchaka added the comment:
Personally I doubt it is a good idea to convert any tuple to named tuple. There
are downsides: this increases memory usage and decreases performance; this
changes pickled data and makes it backward incompatible (and even worse with
other serialization
Claudiu.Popa added the comment:
But it improves the API. It's much nicer to actually access the values returned
by sndhdr as f.type, f.sampling_rate, f.channels than f[0], f[1], f[2]. You do
have a point though. Would it be more acceptable if we'll provide a new
function which returns a
Claudiu.Popa added the comment:
Ping. :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Claudiu.Popa pcmantic...@gmail.com:
--
versions: +Python 3.5 -Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
___
Claudiu.Popa added the comment:
Ping, please review. I guess it is minimal enough to get into 3.4.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
Changes by Claudiu.Popa pcmantic...@gmail.com:
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +r.david.murray
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18615
___
New submission from Claudiu.Popa:
Both sndhdr.whathdr an sndhdr.what returns a tuple with various information,
while it could return a namedtuple. I attached a patched for this, with tests
as well.
--
components: Library (Lib)
files: sndhdr.patch
keywords: patch
messages: 194080
nosy:
21 matches
Mail list logo