On 5 March 2014 12:04, Steven D'Aprano firstname.lastname@example.org wrote:
On Wed, Mar 05, 2014 at 11:29:10AM +0000, Oscar Benjamin wrote:
I don't agree with Mark's proposal in this thread but I would like to have decimal literals e.g. 1.23d,
+1 on that. Although that will depend on how big a slowdown it causes to Python's startup time.
If it is a significant slowdown then it can be a delayed import that only occurs when a decimal literal is first encountered. Applications that don't need decimal won't be slowed down. Applications that do would have had to import it anyway.
and I would also use Fraction literals if available e.g. 1/3F.
Out of curiosity, why F rather than f?
In C and some other languages the f suffix indicates a numeric literal that has type "float" e.g. "6.0f". You can use upper case there as well but the convention is lower case and to include the .0 when it's an integer. I just though that 3F looks sufficiently distinct from the way it's typically done in C.