What is considered an "advanced" topic in Python?

Chris Angelico rosuav at gmail.com
Sun May 31 23:43:31 EDT 2015


On Mon, Jun 1, 2015 at 1:18 PM,  <random832 at fastmail.us> wrote:
> On Fri, May 29, 2015, at 13:08, Chris Angelico wrote:
>> Also, I like talking about Fraction and
>> Decimal for the simple reason that they're unobvious; you can poke
>> around with Python and discover int and float, and if ever you need
>> imaginary/complex numbers, you'll quickly come across complex, but you
>> might use Python for years and not realize that decimal.Decimal even
>> exists - nor when you'd want it.
>
> Well, isn't that just a byproduct of what problem space you work in? If
> someone _does_ know they need a rational or decimal type (e.g. someone
> working with money who's clueful enough to know floats won't do),
> they'll find these types relatively quickly from a google search -
> there's no glut of third-party implementations, and neither is so
> obscure nor easily written from scratch that people wouldn't search for
> an existing implementation.

Yes, but how many people actually know they need a rational type? Just
now there's a thread on python-ideas that was based around the
expectation that a float could do that, which it can't; the OP just
naturally assumed that float was the data type he should be using.

ChrisA



More information about the Python-list mailing list