On Fri, Mar 19, 2010 at 3:15 AM, Wojciech Malinowski <[email protected]> wrote:
> What about the API (and implementation) I proposed in this thread:
> http://groups.google.com/group/pylons-devel/browse_thread/thread/effd139d79f8c665?hl=en
>
> If you like it I can make it a little bit more readable and add a
> docstring next week.

that looks good. I've just been hoping somebody would offer to make a
finished version because I haven't had time.

My preferences would be:

- Change "raise Exception" to "raise ValueError" for argument errors,
per Python tradition. Although why do we need to restrict the unit
name? If a new unit comes into vogue or people want to count
kiloelephants, why not? I think we'd just need additional arguments
for singular and plural. How about making that the main function, and
convenience function(s) for bits and bytes.

- Should 'binary_prefix' default to False now that base 1000 is
recommended for most situations except memory, and that this is a new
helper?

-- 
Mike Orr <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to