[SciPy-Dev] return named tuples

Ralf Gommers ralf.gommers at gmail.com
Tue Sep 9 13:53:06 EDT 2014


On Tue, Sep 9, 2014 at 6:16 PM, Daniel da Silva <mail at danieldasilva.org>
wrote:

> Are the namedtuple subclasses used to create return values going to be
> made available? If so, what's the convention on where they will be placed?
>

They should remain private I'd think.



>
>
>>>> Sounds good to me.  This could eventually be applied to many
>>>> functions in scipy.
>>>>
>>>> Before adding this feature to a function, look for any related
>>>> functions that might return similar values.   We should try to
>>>> ensure that return values with the same meaning are consistently
>>>> given the same name.  We should avoid, for example, one statistical
>>>> test using "p", another using "pvalue" and third using "p_value".
>>>>
>>>> We'll also need to update our docstring standard to include guidelines
>>>> for documenting such return values.
>>>>
>>>
>>> It's nice for users, but doesn't help for developing the code.
>>>
>>> It's backwards compatible but not "future proof".
>>> For example it's a pain that we cannot change the returns of linregress
>>> to add some additional things because it would break the behavior as a
>>> tuple.
>>>
>>
True, but an orthogonal discussion. We may decide to break backwards compat
on a case by case basis, but there would have to be very good reasons to do
so. Using namedtuples is a straightforward improvement

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20140909/027d5185/attachment.html>


More information about the SciPy-Dev mailing list