[Python-ideas] Hexadecimal floating literals
ncoghlan at gmail.com
Sun Sep 24 07:39:03 EDT 2017
On 23 September 2017 at 03:15, Tim Peters <tim.peters at gmail.com> wrote:
> But if they see a rare:
> x = float.fromhex("0x1.aaap-4")
> they can Google for "python fromhex" and find the docs themselves at
> once. The odd method name makes it highly "discoverable", and I think
> that's a feature for rare gimmicks with a small, specialized audience.
Given how often I've used "It's hard to search for magic syntax" as a
design argument myself, I'm surprised I missed the fact it also
applies in this case.
Now that you've brought it up though, I think it's a very good point,
and it's enough to switch me from +0 to -1.
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas