mirror of
https://github.com/satwikkansal/wtfpython
synced 2024-11-25 20:44:24 +01:00
Fix typos
Fixes 3 spelling mistakes.
This commit is contained in:
commit
fe050b8198
4
README.md
vendored
4
README.md
vendored
@ -1375,7 +1375,7 @@ The midnight time is not printed.
|
|||||||
|
|
||||||
#### 💡 Explanation:
|
#### 💡 Explanation:
|
||||||
|
|
||||||
Before Python 3.5, the boolean value fo `datetime.time` object was considered to be `False` if it represented midnight in UTC. It is error-prone when using the `if obj:` syntax to check if the `obj` is null or some equivalent of "empty."
|
Before Python 3.5, the boolean value for `datetime.time` object was considered to be `False` if it represented midnight in UTC. It is error-prone when using the `if obj:` syntax to check if the `obj` is null or some equivalent of "empty."
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -1547,7 +1547,7 @@ a, b = a[b] = {}, 5
|
|||||||
* Few weird looking but semantically correct statements:
|
* Few weird looking but semantically correct statements:
|
||||||
+ `[] = ()` is a semantically correct statement (unpacking an empty `tuple` into an empty `list`)
|
+ `[] = ()` is a semantically correct statement (unpacking an empty `tuple` into an empty `list`)
|
||||||
+ `'a'[0][0][0][0][0]` is also a semantically correct statement as strings are iterable in Python.
|
+ `'a'[0][0][0][0][0]` is also a semantically correct statement as strings are iterable in Python.
|
||||||
+ `3 --0-- 5 == 8` and `--5 == 5` are both semantically correct statments and evalute to `True`.
|
+ `3 --0-- 5 == 8` and `--5 == 5` are both semantically correct statements and evaluate to `True`.
|
||||||
|
|
||||||
* Python uses 2 bytes for local variable storage in functions. In theory, this means that only 65536 variables can be defined in a function. However, python has a handy solution built in that can be used to store more than 2^16 variable names. The following code demonstrates what happens in the stack when more than 65536 local variables are defined (Warning: This code prints around 2^18 lines of text, so be prepared!):
|
* Python uses 2 bytes for local variable storage in functions. In theory, this means that only 65536 variables can be defined in a function. However, python has a handy solution built in that can be used to store more than 2^16 variable names. The following code demonstrates what happens in the stack when more than 65536 local variables are defined (Warning: This code prints around 2^18 lines of text, so be prepared!):
|
||||||
```py
|
```py
|
||||||
|
Loading…
Reference in New Issue
Block a user