Issue 20240: Whitespace ignored in relative imports: from.package import something is valid syntax (original) (raw)

This is no different from other places in python where white space is optional. As long as the parser can tell the end of a token, there need not be white space before the next token.

For example:

1+2 3 1 + 2 3

However, if the parser cannot tell the end of a token, white space is required:

1.add File "", line 1 1.add ^ SyntaxError: invalid syntax 1 .add <method-wrapper '__add__' of int object at 0x1300c68>

We're not likely to add "required white space" after the "from" token.

[I realize that in a "whitespace required" language, this is a slightly odd statement!]