[Python-ideas] Extend module objects to support properties

Chris Angelico rosuav at gmail.com
Fri Feb 1 00:36:51 CET 2013


On Fri, Feb 1, 2013 at 10:26 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> On 01/02/13 09:00, Chris Angelico wrote:
>> I've never actually been in the situation of doing it, but wouldn't it
>> be reasonable to switch out math.pi to be (say) a decimal.Decimal
>> rather than a float?
>
> To what purpose? Monkey-patching math.pi doesn't affect any of the other
> math
> functions. All it will do is break Python code that uses math.pi and expects
> it to be a float.

True. I guess you'd just have your own local pi for that. (Your own
local bakery maybe?) Consider the notion withdrawn.

ChrisA



More information about the Python-ideas mailing list