You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-29Lines changed: 28 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
> Just when you thought, Python could not be more fun.
2
2
3
-
### 1. Hello World
3
+
### 1. Hello World[^hello-world]
4
4
5
5
```py
6
6
>>>import __hello__
@@ -20,7 +20,7 @@ Hello World!
20
20
Hello World!
21
21
```
22
22
23
-
### 2. The classic
23
+
### 2. The classic[^the-classic]
24
24
```
25
25
>>> import this
26
26
@@ -47,12 +47,12 @@ If the implementation is easy to explain, it may be a good idea.
47
47
Namespaces are one honking great idea -- let's do more of those!
48
48
```
49
49
50
-
### 3. The missing line from the classic
50
+
### 3. The missing line from the classic[^missing-zen]
51
51
52
52
The Zen of Python was introduced in [PEP 20](https://www.python.org/dev/peps/pep-0020/#id2). It is supposed to be 20 aphorisms, but only 19 of which have been written down.
53
53
54
54
55
-
### 4. A simple life lesson
55
+
### 4. A simple life lesson[^import-this]
56
56
```py
57
57
>>>import this
58
58
...
@@ -69,22 +69,22 @@ True
69
69
True
70
70
```
71
71
72
-
### 5. Comics, yeah.
72
+
### 5. Comics, yeah.[^antigravity]
73
73
```py
74
74
>>>import antigravity
75
75
```
76
76
77
-
### 6. It's not a choice, it defines who we are
77
+
### 6. It's not a choice, it defines who we are[^braces]
78
78
```py
79
79
>>>from__future__import braces
80
80
File "<stdin>", line 1
81
81
SyntaxError: not a chance
82
82
```
83
83
84
-
### 7. Origins
84
+
### 7. Origins[^origins]
85
85
The name Python has nothing to do with the type of Snake.
86
86
87
-
### 8. The confuscation
87
+
### 8. The confuscation[^this-py]
88
88
This is how the `this.py` module looks, which prints the Zen of Python.
89
89
90
90
```py
@@ -122,13 +122,13 @@ The code for the Zen violates itself. It's not beautiful but ugly, not explicit
122
122
This would probably be the *only* module to go against the spirit of what it says itself.
123
123
.
124
124
125
-
### 9. C/C++ anyone?
125
+
### 9. C/C++ anyone?[^c-c++]
126
126
From the Zen again,
127
127
```
128
128
There should be one-- and preferably only one --obvious way to do it.
129
129
```
130
130
131
-
### 10. Naming identifiers can be unspeakably cool
131
+
### 10. Naming identifiers can be unspeakably cool[^identifiers]
132
132
Just when you thought that working in Python couldn't possibly *be* any more fun,
133
133
```py
134
134
>>>from math import pi
@@ -140,7 +140,7 @@ Just when you thought that working in Python couldn't possibly *be* any more fun
140
140
True
141
141
```
142
142
143
-
### 11. Picking a place for meetup?
143
+
### 11. Picking a place for meetup?[^geohash]
144
144
```py
145
145
>>>from antigravity import geohash
146
146
>>># Your location, a date and that date's (or most recent) DJIA opening.
@@ -150,7 +150,7 @@ True
150
150
This can generate a GPS coordinate in a region which is 1 longitude long and 1
151
151
latitude wide based on your location.
152
152
153
-
### 12. The FLUFL - Friendly Language Uncle For Life from [PEP 401 -- BDFL Retirement](https://www.python.org/dev/peps/pep-0401)
153
+
### 12. The FLUFL - Friendly Language Uncle For Life from [PEP 401 -- BDFL Retirement](https://www.python.org/dev/peps/pep-0401)[^pep-401]
154
154
```py
155
155
>>>from__future__import barry_as_FLUFL
156
156
>>>1<>2
@@ -163,7 +163,7 @@ SyntaxError: invalid syntax
163
163
```
164
164
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.
165
165
166
-
### 13. InPynite?
166
+
### 13. InPynite?[^inpynite]
167
167
```py
168
168
>>> infinity =float('infinity')
169
169
>>>hash(infinity)
@@ -193,7 +193,7 @@ class code(object)
193
193
...
194
194
```
195
195
196
-
### 15. Python 3.9 PEG parser
196
+
### 15. Python 3.9 PEG parser[^peg-parser]
197
197
`__peg_parser__` is a keyword in python 3.9, will throw a syntax error if used
198
198
```py
199
199
>>> __peg_parser__
@@ -203,21 +203,20 @@ class code(object)
203
203
SyntaxError: You found it!
204
204
```
205
205
206
-
## Notes
207
-
1. Easiest hello world program in a language without calling any function
208
-
2. Each and every line is the philosophy of Python's design and is a supreme holy guide
209
-
3. Maybe just to show that there always should be a new line at the end of a file!
210
-
4. Not an easter egg, a joke in the interpreter
211
-
5. It opens this [xkcd comic](https://xkcd.com/353) which demonstrates how easy it is to do stuff with modules
212
-
6. This is to instantly close down any conversation about introducing curly braces to Python
213
-
7. Guido van Rossum is a big fan of [Monty Python's Flying Circus](https://en.wikipedia.org/wiki/Monty_Python%27s_Flying_Circus)
214
-
8. It's a substitution cipher called [ROT13](https://en.wikipedia.org/wiki/ROT13)
215
-
9. In many languages there are two ways to do the same thing `--no` and `no--`. The message has a hidden example in itself
216
-
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
217
-
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
218
-
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)).
14. See [this answer](https://stackoverflow.com/a/65487013/14362510)
206
+
[^hello-world]: Easiest hello world program in a language without calling any function
207
+
[^the-classic]: Each and every line is the philosophy of Python's design and is a supreme holy guide
208
+
[^missing-zen]: Maybe just to show that there always should be a new line at the end of a file!
209
+
[^import-this]: Not an easter egg, a joke in the interpreter
210
+
[^antigravity]: It opens this [xkcd comic](https://xkcd.com/353) which demonstrates how easy it is to do stuff with modules
211
+
[^braces]: This is to instantly close down any conversation about introducing curly braces to Python
212
+
[^origins]: Guido van Rossum is a big fan of [Monty Python's Flying Circus](https://en.wikipedia.org/wiki/Monty_Python%27s_Flying_Circus)
213
+
[^this-py]: It's a substitution cipher called [ROT13](https://en.wikipedia.org/wiki/ROT13)
214
+
[^c-c++]: In many languages there are two ways to do the same thing `--no` and `no--`. The message has a hidden example in itself
215
+
[^identifiers]: 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
216
+
[^geohash]: 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
217
+
[^pep-401]: 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)).
0 commit comments