Skip to content

Commit 888c9e1

Browse files
committed
Fix indenting, add a minor example, and update contributing message
1 parent e18e56e commit 888c9e1

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3377,9 +3377,9 @@ Let's increase the number of iterations by a factor of 10.
33773377
True
33783378
>>> False ** True == False
33793379
True
3380-
>>> True ** False == True
3380+
>>> True ** False == True
33813381
True
3382-
>>> True ** True == True
3382+
>>> True ** True == True
33833383
True
33843384
```
33853385
@@ -3395,6 +3395,13 @@ Let's increase the number of iterations by a factor of 10.
33953395
33963396
**💡 Explanation:** The `@` operator was added in Python 3.5 keeping scientific community in mind. Any object can overload `__matmul__` magic method to define behavior for this operator.
33973397
3398+
* From Python 3.8 onwards you can use a typical f-string syntax like `f'{some_var=}` for quick debugging. Example,
3399+
```py
3400+
>>> some_string = "wtfpython"
3401+
>>> f'{some_string=}'
3402+
"string='wtfpython'"
3403+
```
3404+
33983405
* 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!):
33993406
34003407
```py
@@ -3454,17 +3461,25 @@ f()
34543461
The behavior is due to the matching of empty substring(`''`) with slices of length 0 in the original string.
34553462
34563463
---
3457-
3458-
<p align="center">~~~ That's all folks! ~~~</p>
34593464
---
34603465
34613466
# Contributing
34623467
3463-
All patches are welcome! Please see [CONTRIBUTING.md](/CONTRIBUTING.md) for further details. For discussions, you can either create a new [issue](https://github.com/satwikkansal/wtfpython/issues/new) or ping on the Gitter [channel](https://gitter.im/wtfpython/Lobby)
3468+
Here are a few ways that you can contribute to wtfpython,
3469+
3470+
- Suggesting new examples
3471+
- Helping with translation (See issues labeled translation)
3472+
- Minor corrections like pointing out outdated snippets, typos, formatting errors, etc
3473+
- Identifying gaps (things inadequate explanation, redundancy, etc)
3474+
- Suggestions in general for making this project more fun and useful
3475+
3476+
Please see [CONTRIBUTING.md](/CONTRIBUTING.md) for more details. Feel free to create a new [issue](https://github.com/satwikkansal/wtfpython/issues/new).
3477+
3478+
PS: Please don't reach out with backlinking requests, no links will be added unless they're highly relevant to the project.
34643479
34653480
# Acknowledgements
34663481
3467-
The idea and design for this collection were initially inspired by Denys Dovhan's awesome project [wtfjs](https://github.com/denysdovhan/wtfjs). The overwhelming support by the community gave it the shape it is in right now.
3482+
The idea and design for this collection were initially inspired by Denys Dovhan's awesome project [wtfjs](https://github.com/denysdovhan/wtfjs). The overwhelming support by the community gave it the shape it is in right now.
34683483
34693484
#### Some nice Links!
34703485
* https://www.youtube.com/watch?v=sH4XF6pKKmk

0 commit comments

Comments
 (0)