Working with decimals

Joshua Landau joshua at landau.ws
Sat Aug 23 18:47:52 EDT 2014


On 23 August 2014 23:31, Chris Angelico <rosuav at gmail.com> wrote:
> On Sun, Aug 24, 2014 at 7:47 AM, Joshua Landau <joshua at landau.ws> wrote:
>> So for one "import math" should never go inside a function; you should
>> hoist it to the top of the file with all the other imports.
>
> I'd say "never" is too strong (there are times when it's right to put
> an import inside a function), but yes, in this case it should really
> be at the top of the function.

But do any of them apply to "import math"?

> However, you won't need the import at all if you let the formatting
> function do the rounding for you.

Can that floor?



More information about the Python-list mailing list