Skip to content

Commit aa3a266

Browse files
authored
Merge pull request #5 from kaustubhhiware/infinity
Add infinity-> pi easter egg
2 parents 8f6f65d + 3b3a133 commit aa3a266

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@ SyntaxError: invalid syntax
150150
```
151151
Recognized that the != inequality operator in Python 3.0 was a horrible, finger pain inducing mistake, the FLUFL reinstates the <> diamond operator as the sole spelling.
152152

153+
### 13. InPynite?
154+
```py
155+
>>> infinity = float('infinity')
156+
>>> hash(infinity)
157+
314159
158+
>>> hash(float('-inf'))
159+
-314159
160+
```
161+
A hash is a fixed sized integer that identifies a particular value. On a closer look, the hash of infinity is 10^5 x pi. Interestingly, hash(float('-inf')) yields -10^5 x pi in python3, whereeas -271828 i.e - 10^5 x e in python2.
162+
153163
## Notes
154164
1. Easiest hello world program in a language without calling any function
155165
2. Each and every line is the philosophy of Python's design and is a supreme holy guide
@@ -163,6 +173,7 @@ Recognized that the != inequality operator in Python 3.0 was a horrible, finger
163173
10. Support for unicode character set for naming identifiers was added in Python3. Though, it is not explicitly preferred while writing code, it adds flavour to working with scientific formulas
164174
11. The original code is [here](https://github.com/python/cpython/blob/master/Lib/antigravity.py) with the [xkcd comic](https://xkcd.com/426/) referenced, and maybe that's why this is also in the `antigravity` module
165175
12. The [PEP 401](https://www.python.org/dev/peps/pep-0401/) is an April Fools' Joke - The PEP's number is 401, i.e. 4/01 or April 1st (April Fools' Day). The PEP states that Guido van Rossum is stepping down. The new title given to him would be pronounced "BDEVIL" (Benevolent Dictator Emeritus Vacationing Indefinitely from the Language) and Guido's successor will be Barry Warsaw, or as he is affectionately known, Uncle Barry. Uncle Barry's official title is "FLUFL" (Friendly Language Uncle For Life). There are in-jokes about the Parrot virtual machine and the "non-existent" Python Secret Underground (possibly a throw-back to ["TINC" on USENET](https://en.wikipedia.org/wiki/There_Is_No_Cabal)).
176+
13. [Source](https://www.reddit.com/r/Python/comments/6wrd8t/nice_lil_easter_egg_i_suppose/).
166177

167178
## Add more
168179

0 commit comments

Comments
 (0)