1 comments

@blue_note 2019-10-09 14:28:47

No, and there can't be. In the first case, it's a literal and it can be parsed in a special way. In the second case, it's an expression. There's no way for the language to differentiate what you mean from any normal expression.

See example grammar for how float literals are parsed. It regards older version of python, but I can't find it in the grammar of recent versions.

https://docs.python.org/2.0/ref/floating.html

Related Questions

Sponsored Content

19 Answered Questions

[SOLVED] Using global variables in a function

20 Answered Questions

[SOLVED] Are static class variables possible in Python?

26 Answered Questions

[SOLVED] How do I pass a variable by reference?

11 Answered Questions

[SOLVED] How to access environment variable values?

32 Answered Questions

[SOLVED] Understanding slice notation

24 Answered Questions

[SOLVED] How to read a text file into a string variable and strip newlines?

  • 2011-12-03 16:47:54
  • klijo
  • 1342793 View
  • 958 Score
  • 24 Answer
  • Tags:   python string

42 Answered Questions

[SOLVED] Checking whether a variable is an integer or not

  • 2010-08-17 10:15:08
  • Hulk
  • 1334030 View
  • 899 Score
  • 42 Answer
  • Tags:   python

1 Answered Questions

3 Answered Questions

Sponsored Content