This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients Christian.Kleineidam, NeilGirdhar, aisaac, dkorchem, madison.may, mark.dickinson, pitrou, rhettinger, serhiy.storchaka, tim.peters, westley.martinez, xksteven
Date 2016-04-07.07:43:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> One to make it return a single number if amount == 1 and the other to check that the amount > 1.

Suggestion: if you want to go that way, return a single number if `amount` is not provided (so make the default value for `amount` None rather than 1). If `amount=1` is explicitly given, a list containing one item should be returned.

I also think there's no reason to raise an exception when `amount = 0`: just return an empty list.

For comparison, here's NumPy's "uniform" generator, which generates a scalar if the "size" parameter is not given, and an array if "size" is given, even if it's 1.

>>> np.random.uniform()
>>> np.random.uniform(size=1)
array([ 0.64817717])
>>> np.random.uniform(size=0)
array([], dtype=float64)
Date User Action Args
2016-04-07 07:43:46mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, pitrou, aisaac, westley.martinez, serhiy.storchaka, NeilGirdhar, madison.may, dkorchem, Christian.Kleineidam, xksteven
2016-04-07 07:43:46mark.dickinsonsetmessageid: <>
2016-04-07 07:43:46mark.dickinsonlinkissue18844 messages
2016-04-07 07:43:45mark.dickinsoncreate