mirror of
https://github.com/satwikkansal/wtfpython
synced 2024-11-22 11:04:25 +01:00
Remove "Suggested by" from the examples.
* Because a major refactor of examples has to be done. * Our awesome contributors are duly credited in the new CONTRIBUTORS.md
This commit is contained in:
parent
7d667bb3fd
commit
92fa8039db
25
README.md
vendored
25
README.md
vendored
@ -1799,8 +1799,6 @@ tuple()
|
|||||||
|
|
||||||
### Teleportation
|
### Teleportation
|
||||||
|
|
||||||
Suggested in [this](https://www.reddit.com/r/Python/comments/6x6upn/wtfpython_a_collection_of_interesting_and_tricky/dme96dq/) reddit thread.
|
|
||||||
|
|
||||||
```py
|
```py
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
@ -1831,8 +1829,6 @@ Is it worth a Nobel Prize?
|
|||||||
|
|
||||||
### yielding None
|
### yielding None
|
||||||
|
|
||||||
Suggested by @chris-rands in [this](https://github.com/satwikkansal/wtfpython/issues/32) issue.
|
|
||||||
|
|
||||||
```py
|
```py
|
||||||
some_iterable = ('a', 'b')
|
some_iterable = ('a', 'b')
|
||||||
|
|
||||||
@ -1863,8 +1859,6 @@ def some_func(val):
|
|||||||
|
|
||||||
### The surprising comma
|
### The surprising comma
|
||||||
|
|
||||||
Suggested by @MostAwesomeDude in [this](https://github.com/satwikkansal/wtfPython/issues/1) issue.
|
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
```py
|
```py
|
||||||
>>> def f(x, y,):
|
>>> def f(x, y,):
|
||||||
@ -1895,8 +1889,6 @@ SyntaxError: invalid syntax
|
|||||||
|
|
||||||
### For what?
|
### For what?
|
||||||
|
|
||||||
Suggested by @MittalAshok in [this](https://github.com/satwikkansal/wtfpython/issues/23) issue.
|
|
||||||
|
|
||||||
```py
|
```py
|
||||||
some_string = "wtf"
|
some_string = "wtf"
|
||||||
some_dict = {}
|
some_dict = {}
|
||||||
@ -1917,7 +1909,7 @@ for i, some_dict[i] in enumerate(some_string):
|
|||||||
for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite]
|
for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite]
|
||||||
```
|
```
|
||||||
Where `exprlist` is the assignment target. This means that the equivalent of `{exprlist} = {next_value}` is **executed for each item** in the iterable.
|
Where `exprlist` is the assignment target. This means that the equivalent of `{exprlist} = {next_value}` is **executed for each item** in the iterable.
|
||||||
An interesting example suggested by @tukkek in [this](https://github.com/satwikkansal/wtfPython/issues/11) issue illustrates this:
|
An interesting example that illustrates this:
|
||||||
```py
|
```py
|
||||||
for i in range(4):
|
for i in range(4):
|
||||||
print(i)
|
print(i)
|
||||||
@ -1950,8 +1942,6 @@ for i, some_dict[i] in enumerate(some_string):
|
|||||||
|
|
||||||
### not knot!
|
### not knot!
|
||||||
|
|
||||||
Suggested by @MostAwesomeDude in [this](https://github.com/satwikkansal/wtfPython/issues/1) issue.
|
|
||||||
|
|
||||||
```py
|
```py
|
||||||
x = True
|
x = True
|
||||||
y = False
|
y = False
|
||||||
@ -1979,8 +1969,6 @@ SyntaxError: invalid syntax
|
|||||||
|
|
||||||
### Subclass relationships
|
### Subclass relationships
|
||||||
|
|
||||||
Suggested by @Lucas-C in [this](https://github.com/satwikkansal/wtfpython/issues/36) issue.
|
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
```py
|
```py
|
||||||
>>> from collections import Hashable
|
>>> from collections import Hashable
|
||||||
@ -2005,8 +1993,6 @@ The Subclass relationships were expected to be transitive, right? (i.e. if `A` i
|
|||||||
|
|
||||||
### Mangling time!
|
### Mangling time!
|
||||||
|
|
||||||
Suggested by @Lucas-C in [this](https://github.com/satwikkansal/wtfpython/issues/36) issue.
|
|
||||||
|
|
||||||
|
|
||||||
```py
|
```py
|
||||||
class Yo(object):
|
class Yo(object):
|
||||||
@ -2037,9 +2023,6 @@ Why did `Yo()._Yo__honey` worked? Only Indian readers would understand.
|
|||||||
|
|
||||||
### Deep down, we're all the same.
|
### Deep down, we're all the same.
|
||||||
|
|
||||||
Suggested by @Lucas-C in [this](https://github.com/satwikkansal/wtfpython/issues/36) issue.
|
|
||||||
|
|
||||||
|
|
||||||
```py
|
```py
|
||||||
class WTF:
|
class WTF:
|
||||||
pass
|
pass
|
||||||
@ -2083,8 +2066,6 @@ True
|
|||||||
|
|
||||||
### Half triple-quoted strings
|
### Half triple-quoted strings
|
||||||
|
|
||||||
Suggested by @asottile in [this](https://github.com/satwikkansal/wtfpython/issues/40) issue.
|
|
||||||
|
|
||||||
**Output:**
|
**Output:**
|
||||||
```py
|
```py
|
||||||
>>> print('wtfpython''')
|
>>> print('wtfpython''')
|
||||||
@ -2166,8 +2147,6 @@ str
|
|||||||
|
|
||||||
### Stubborn `del` operator
|
### Stubborn `del` operator
|
||||||
|
|
||||||
Suggested by @tukkek in [this](https://github.com/satwikkansal/wtfpython/issues/26) issue.
|
|
||||||
|
|
||||||
```py
|
```py
|
||||||
class SomeClass:
|
class SomeClass:
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
@ -2211,8 +2190,6 @@ Okay, now it's deleted :confused:
|
|||||||
|
|
||||||
### Let's see if you can guess this?
|
### Let's see if you can guess this?
|
||||||
|
|
||||||
Suggested by @PiaFraus in [this](https://github.com/satwikkansal/wtfPython/issues/9) issue.
|
|
||||||
|
|
||||||
```py
|
```py
|
||||||
a, b = a[b] = {}, 5
|
a, b = a[b] = {}, 5
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user