[Python-ideas] Hexadecimal floating literals

Steven D'Aprano steve at pearwood.info
Mon Sep 11 21:48:44 EDT 2017


On Tue, Sep 12, 2017 at 12:45:37AM +0200, Victor Stinner wrote:
> Instead of modifying the Python grammar, the alternative is to enhance
> float(str) to support it:
> 
> k = float("0x1.2492492492492p-3") # 1/7

Why wouldn't you just write 1/7?



-- 
Steve


More information about the Python-ideas mailing list