Skip to content

Commit 80a969a

Browse files
committed
Brace yourself: Add to explanation
Resolves satwikkansal#114
1 parent 2bfa6d2 commit 80a969a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,11 +2148,13 @@ from __future__ import braces
21482148
SyntaxError: not a chance
21492149
```
21502150
2151-
Braces? No way! If you think that's disappointing, use Java.
2151+
Braces? No way! If you think that's disappointing, use Java. Okay, another surprising thing, can you find where's the `SyntaxError` raised in `__future__` module [code](https://github.com/python/cpython/blob/master/Lib/__future__.py)?
21522152
21532153
#### 💡 Explanation:
2154-
+ The `__future__` module is normally used to provide features from future versions of Python. The "future" here is however ironic.
2154+
+ The `__future__` module is normally used to provide features from future versions of Python. The "future" in this specific context is however ironic.
21552155
+ This is an easter egg concerned with the community's feelings on this issue.
2156+
+ The code is actually present [here](https://github.com/python/cpython/blob/025eb98dc0c1dc27404df6c544fc2944e0fa9f3a/Python/future.c#L49) in `future.c` file.
2157+
+ When the CPython compiler encounters a [future statement](https://docs.python.org/3.3/reference/simple_stmts.html#future-statements), it first runs the appropriate code in `future.c` before treating it as a normal import statement.
21562158
21572159
---
21582160

0 commit comments

Comments
 (0)