Skip to content

Commit

Permalink
Brace yourself: Add to explanation
Browse files Browse the repository at this point in the history
Resolves #114
  • Loading branch information
satwikkansal committed Sep 13, 2019
1 parent 2295fb2 commit ae05101
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2210,11 +2210,13 @@ from __future__ import braces
SyntaxError: not a chance
```

Braces? No way! If you think that's disappointing, use Java.
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)?

#### 💡 Explanation:
+ The `__future__` module is normally used to provide features from future versions of Python. The "future" here is however ironic.
+ The `__future__` module is normally used to provide features from future versions of Python. The "future" in this specific context is however ironic.
+ This is an easter egg concerned with the community's feelings on this issue.
+ The code is actually present [here](https://github.com/python/cpython/blob/025eb98dc0c1dc27404df6c544fc2944e0fa9f3a/Python/future.c#L49) in `future.c` file.
+ 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.

---

Expand Down

0 comments on commit ae05101

Please sign in to comment.