Are there any other uses for Python's "from" keyword aside from import statements?
They are for defining the syntax and structures of Python language. You should know there are 33 keywords in Python programming language as of writing this tutorial. Although the number can vary in course of time. Also keywords in Python is case sensitive.
No and yes.
According to the official Python 2.7.2 grammar, the only occurrence of the word from is in the clause import_from, so no.
In the Python 3.1.3 grammar a new clause
raise_stmt: 'raise' [test ['from' test]]
appears, so yes.
There is a new syntax for delegating to a subgenerator in Python 3.3 which uses the from keyword.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With