From 145a194c8b138ee0f71593fef63290df601df8fb Mon Sep 17 00:00:00 2001 From: Chris J Date: Wed, 3 Oct 2018 01:07:17 -0700 Subject: [PATCH 1/9] Update README.md (#95) Fixed a small typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f116bd..d9b9563 100644 --- a/README.md +++ b/README.md @@ -1903,7 +1903,7 @@ Sshh.. It's a super secret. #### πŸ’‘ Explanation: + `antigravity` module is one of the few easter eggs released by Python developers. + `import antigravity` opens up a web browser pointing to the [classic XKCD comic](http://xkcd.com/353/) about Python. -+ Well, there's more to it. There's **another easter egg inside the easter egg**. If look at the [code](https://github.com/python/cpython/blob/master/Lib/antigravity.py#L7-L17), there's a function defined that purports to implement the [XKCD's geohashing algorithm](https://xkcd.com/426/). ++ Well, there's more to it. There's **another easter egg inside the easter egg**. If you look at the [code](https://github.com/python/cpython/blob/master/Lib/antigravity.py#L7-L17), there's a function defined that purports to implement the [XKCD's geohashing algorithm](https://xkcd.com/426/). --- From d7477885b863dc8194ac65eefed49a7c22dfd43d Mon Sep 17 00:00:00 2001 From: Satwik Kansal Date: Wed, 5 Dec 2018 04:16:32 +0530 Subject: [PATCH 2/9] Update broken link --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d9b9563..855e2ac 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ While some of the examples you see below may not be WTFs in the truest sense, bu If you're an experienced Python programmer, you can take it as a challenge to get most of them right in first attempt. You may be already familiar with some of these examples, and I might be able to revive sweet old memories of yours being bitten by these gotchas :sweat_smile: -If you're a returning reader, you can learn about the new modifications [here](https://github.com/satwikkansal/wtfpython/releases/). +PS: If you're a returning reader, you can learn about the new modifications [here](https://github.com/satwikkansal/wtfpython/releases/). So, here we go... @@ -2358,7 +2358,7 @@ The idea and design for this collection were initially inspired by Denys Dovhan' * https://stackoverflow.com/questions/530530/python-2-x-gotchas-and-landmines * https://stackoverflow.com/questions/1011431/common-pitfalls-in-python * https://www.python.org/doc/humor/ -* https://www.satwikkansal.xyz/archives/posts/python/My-Python-archives/ +* https://www.codementor.io/satwikkansal/python-practices-for-efficient-code-performance-memory-and-usability-aze6oiq65 # πŸŽ“ License @@ -2373,9 +2373,9 @@ The idea and design for this collection were initially inspired by Denys Dovhan' If you have any wtfs, ideas or suggestions, please share. -## Want to surprise your geeky pythonist friends? +## Surprise your geeky pythonist friends? -You can recommend wtfpython to your friends on Twitter and Linkedin by using these quick links, +You can use these quick links to recommend wtfpython to your friends, [Twitter](https://twitter.com/intent/tweet?url=https://github.com/satwikkansal/wtfpython&hastags=python,wtfpython) | [Linkedin](https://www.linkedin.com/shareArticle?url=https://github.com/satwikkansal&title=What%20the%20f*ck%20Python!&summary=An%20interesting%20collection%20of%20subtle%20and%20tricky%20Python%20snippets.) From b0e7a816ec356197699d8c4d799d7c86457dbbaf Mon Sep 17 00:00:00 2001 From: Hannes Date: Wed, 5 Dec 2018 20:45:59 +0100 Subject: [PATCH 3/9] make the function *call* more visible (#104) It is easy to overlook the () in that appending operation, I propose adding a short comment. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 855e2ac..9049fdb 100644 --- a/README.md +++ b/README.md @@ -555,7 +555,7 @@ for x in range(7): def some_func(): return x funcs.append(some_func) - results.append(some_func()) + results.append(some_func()) # note the function call here funcs_results = [func() for func in funcs] ``` From 9c5f26e7588e561a716a93165a5696356c179715 Mon Sep 17 00:00:00 2001 From: Hannes Date: Wed, 5 Dec 2018 20:50:17 +0100 Subject: [PATCH 4/9] match order of display to if/else order (#105) I was WTFing for way too long until I realised that the results were displayed in opposite order of the if/else statement. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9049fdb..79820a0 100644 --- a/README.md +++ b/README.md @@ -774,10 +774,10 @@ for item in mixed_list: **Output:** ```py ->>> booleans_found_so_far -0 >>> integers_found_so_far 4 +>>> booleans_found_so_far +0 ``` 2\. From 64b310953a58ddcb3dc65173d1d4fafdc18c8d49 Mon Sep 17 00:00:00 2001 From: 1f604 <1f604@users.noreply.github.com> Date: Thu, 6 Dec 2018 18:54:45 +0000 Subject: [PATCH 5/9] fix typo (#107) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 79820a0..d59943d 100644 --- a/README.md +++ b/README.md @@ -838,7 +838,7 @@ class C(A): pass ``` -**Ouptut:** +**Output:** ```py >>> A.x, B.x, C.x (1, 1, 1) From 30e05a5973930c38cdb59f1c02b85b19b22ac531 Mon Sep 17 00:00:00 2001 From: kyblockstacking <40349734+kyblockstacking@users.noreply.github.com> Date: Sun, 9 Dec 2018 06:53:28 -0800 Subject: [PATCH 6/9] Rephrase sentence to make more sense (#109) --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 142de18..7f672ac 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -11,4 +11,4 @@ I'm really grateful to all the contributors. Following are the wonderful people | chris-rands | [chris-rands](https://github.com/chris-rands) | [#32](https:/github.com/satwikkansal/wtfpython/issues/32) | | sohaibfarooqi | [sohaibfarooqi](https://github.com/sohaibfarooqi) | [#63](https:/github.com/satwikkansal/wtfpython/issues/63) | -Thank you all for taking out time, and helping to make this project awesome! :smile: +Thank you all for taking out the time to make this project more awesome! :smile: From b262f2975641da1493853a390a171a051f561914 Mon Sep 17 00:00:00 2001 From: Satwik Kansal Date: Sun, 16 Dec 2018 16:23:39 +0530 Subject: [PATCH 7/9] Add reference to chinese translation --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d59943d..9827fc4 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![WTFPL 2.0][license-image]][license-url] +Translations: [Chinese δΈ­ζ–‡](https://github.com/leisurelicht/wtfpython-cn) Python, being a beautifully designed high-level and interpreter-based programming language, provides us with many features for the programmer's comfort. But sometimes, the outcomes of a Python snippet may not seem obvious to a regular user at first sight. From 54883f5134896870436f716b849e935a23e23340 Mon Sep 17 00:00:00 2001 From: Satwik Kansal Date: Sun, 31 Mar 2019 19:08:19 +0530 Subject: [PATCH 8/9] Use http instead of https This will avoid CERTIFICATE_VERIFY_FAILED errors due to SSL. --- wtfpython-pypi/wtf_python/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wtfpython-pypi/wtf_python/main.py b/wtfpython-pypi/wtf_python/main.py index 73de9b8..621995a 100644 --- a/wtfpython-pypi/wtf_python/main.py +++ b/wtfpython-pypi/wtf_python/main.py @@ -4,7 +4,7 @@ try: except ImportError: from urllib import urlretrieve -url = ("https://raw.githubusercontent.com/satwikkansal/" +url = ("http://raw.githubusercontent.com/satwikkansal/" "wtfpython/master/README.md") file_name = "content.md" From 31dcd9b0629f61e6f577c76c31addaf55609109c Mon Sep 17 00:00:00 2001 From: hippie Date: Fri, 7 Jun 2019 02:15:34 +0800 Subject: [PATCH 9/9] add encoding (#122) if not set encoding attr,there maybe have some exceptions when open reading. --- wtfpython-pypi/wtf_python/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wtfpython-pypi/wtf_python/main.py b/wtfpython-pypi/wtf_python/main.py index 621995a..5799178 100644 --- a/wtfpython-pypi/wtf_python/main.py +++ b/wtfpython-pypi/wtf_python/main.py @@ -21,7 +21,7 @@ def fetch_updated_doc(): def render_doc(): - with open(file_name, 'r') as f: + with open(file_name, 'r', encoding='utf-8') as f: content = f.read() pydoc.pager(content)