1
0
mirror of https://github.com/satwikkansal/wtfpython synced 2024-11-25 04:24:23 +01:00

Fixed wrong output of isinstance(False, float)

Fixed the output of `isinstance(False, float)` and changed `False` to `True` to match `isinstance(True, int)`
This commit is contained in:
Jeppe Pihl 2017-09-01 15:13:09 +02:00 committed by GitHub
parent f5565ee615
commit bd05e9e723

4
README.md vendored
View File

@ -1510,8 +1510,8 @@ a, b = a[b] = {}, 5
```py
>>> isinstance(True, int)
True
>>> isinstance(False, float)
True
>>> isinstance(True, float)
False
```
* 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