1
0
mirror of https://github.com/satwikkansal/wtfpython synced 2024-11-10 13:38:53 +01:00

Compare commits

...

427 Commits

Author SHA1 Message Date
Satwik Kansal
ebfa77e509
Merge pull request #352 from nifadyev/delete-cli-version
#345: Delete cli package because it is not convinient to use
2024-10-17 21:32:22 +05:30
Vadim Nifadev
b10e2cbc31 Delete cli package because it is not convinient to use 2024-10-17 15:10:47 +03:00
Satwik Kansal
6abea7bb3e
Merge pull request #344 from nifadyev/feature/#74/add-dark-theme-and-alt-support-for-images
#74: Add dark theme and alt support for images

Resolves #74
Closes #302
Closes #317
2024-10-16 14:29:14 +05:30
Vadim Nifadev
578c82094c Fix image source url in notebook 2024-10-16 09:36:51 +03:00
Vadim Nifadev
6702c78868 Fix images source in notebook 2024-10-15 17:42:15 +03:00
Vadim Nifadev
c3e7cc9bed Change images source in notebook 2024-10-15 17:25:56 +03:00
Vadim Nifadev
4b3818a667 Replace images in notebook 2024-10-15 17:06:52 +03:00
Vadim Nifadev
5402122038 Replace images in russian translation 2024-10-15 17:06:27 +03:00
Vadim Nifadev
0bba8d932c Delete unused images 2024-10-15 15:54:40 +03:00
Vadim Nifadev
d8734aa6ac Fix invalid image path 2024-10-15 15:54:26 +03:00
Vadim Nifadev
daf7ccd2ce Use new theme specific logic for images 2024-10-15 15:51:43 +03:00
Vadim Nifadev
b471c9fa14 Fix image name, remove extra rectangles from dark theme image 2024-10-15 15:05:34 +03:00
Vadim Nifadev
e0411b68fb Use new theme specific logic for images 2024-10-15 14:55:12 +03:00
Vadim Nifadev
9315d0144d Add venv and vscode config folders to .gitignore 2024-10-15 14:54:22 +03:00
Vadim Nifadev
f07d547dc7 Replace string interning image to SVG, add image for dark theme 2024-10-15 14:54:03 +03:00
Satwik Kansal
93d7fb98e6
Merge pull request #316 from raigorx/patch-2
typo: strings-and-the-backslashes
2024-10-11 17:09:52 +05:30
Satwik Kansal
d2673bba08
Merge pull request #334 from nifadyev/master
Change link to Russian translation (follow up to PR #325)
2024-05-13 19:00:49 +05:30
Vadim Nifadev
be4811aeb7 Change link to Russian translation 2024-05-13 09:59:32 +03:00
Satwik Kansal
77af92f780
Merge pull request #325 from nifadyev/master
Add Russian translation
2024-05-10 11:03:39 +05:30
Satwik Kansal
394fa09b07
Merge branch 'master' into master 2024-05-10 11:02:03 +05:30
Satwik Kansal
b251f1b150
Merge pull request #330 from Elkiwa/fix/links_and_typos
Fix some outdated links
2024-05-10 10:54:25 +05:30
Jeremy Cheng
c7f3849c1a
doc: fix links and typos 2024-05-09 17:16:15 +09:00
Vadim Nifadev
d70bf71cb6 Fix link to Russian translation 2024-05-04 20:06:24 +03:00
Vadim Nifadev
8db7d48ad6 Add new link to Russian translation 2024-05-04 20:04:21 +03:00
Vadim Nifadev
39595fc35f Revert README.md 2024-05-04 20:03:28 +03:00
Vadim Nifadev
b6fd12efa2 Revert code-of-conduct.md 2024-05-04 20:01:51 +03:00
Vadim Nifadev
0ec5939713 Revert CONTRIBUTING.md 2024-05-04 19:58:56 +03:00
Vadim Nifadev
19fba38556 Fix links to Russian translation 2024-05-04 19:58:02 +03:00
Vadim Nifadev
16628ba071 Minor changes 2024-05-04 19:05:24 +03:00
Vadim Nifadev
b1684aaf39 Move translated files to translations/ru-russian 2024-05-04 18:58:57 +03:00
Vadim Nifadev
6f35f00461 Translate Code of Conduct 2024-05-03 09:38:55 +03:00
Vadim Nifadev
a2c5a17ca8 Remove extra level of headings from Table of Content 2024-04-29 06:50:59 +03:00
Vadim Nifadev
fcb70ba7b9 Change translation for word "section" 2024-04-29 06:43:47 +03:00
Vadim Nifadev
9687de2a67 Translate CONTRIBUTING guide 2024-04-29 06:36:44 +03:00
Vadim Nifadev
d0dd3ad2b7 Fix typos and spelling 2024-04-27 12:21:12 +03:00
Vadim Nifadev
5bbdcdd5a5 Translate CONTRIBUTORS, fix Markdown table syntax 2024-04-26 10:44:11 +03:00
Vadim Nifadev
2c623dd33a Actualize Table of contents 2024-04-25 11:12:29 +03:00
Vadim Nifadev
f0afccc347 Translate License and remaining info example 2024-04-25 11:08:22 +03:00
Vadim Nifadev
d7d7e970d7 Translate Aknowledgements and links example 2024-04-25 11:04:25 +03:00
Vadim Nifadev
05ad6cf2af Translate Contributing example 2024-04-25 11:00:05 +03:00
Vadim Nifadev
f71b997a45 Translate Minor ones example 2024-04-24 17:00:05 +03:00
Vadim Nifadev
9e2508ae6a Translate Bloating instance dict's example 2024-04-24 16:28:57 +03:00
Vadim Nifadev
4b4951d755 Translate Slowing down dict lookups example 2024-04-24 16:21:51 +03:00
Vadim Nifadev
00e420fc51 Translate Let's make a giant string! example 2024-04-24 16:16:10 +03:00
Vadim Nifadev
ebe5f59a9d Translate += is faster example 2024-04-24 16:06:24 +03:00
Vadim Nifadev
551b251c05 Translate Well, something is fishy example 2024-04-24 16:02:55 +03:00
Vadim Nifadev
eab5d5968e Translate Teleportation example 2024-04-24 15:52:39 +03:00
Vadim Nifadev
a5f1258275 Translate Skipping lines? example 2024-04-24 15:47:58 +03:00
Vadim Nifadev
b5c20d02ea Translate Name mangling example 2024-04-24 15:39:50 +03:00
Vadim Nifadev
3b9d9bdcd1 Translate Inpinity example 2024-04-24 15:29:06 +03:00
Vadim Nifadev
be9c3bb0ae Translate Ellipsis example 2024-04-24 12:24:34 +03:00
Vadim Nifadev
193c839163 Translate Yes, it exists example 2024-04-24 12:17:37 +03:00
Vadim Nifadev
664bb038d4 Translate Even Python understands that love is complicated example 2024-04-24 12:12:47 +03:00
Vadim Nifadev
e2d0be0e2a Translate Meet Friendly Language Uncle For Life example 2024-04-24 12:09:26 +03:00
Vadim Nifadev
8ab55b7393 Translate Brace yourself example 2024-04-24 12:02:09 +03:00
Vadim Nifadev
124b0f027d Translate goto, but why? example 2024-04-24 11:58:51 +03:00
Vadim Nifadev
662b720b5c Translate Okay Python, can you make me fly? example 2024-04-24 11:47:58 +03:00
Vadim Nifadev
039adfa04a Translate Midnight time does not exist? example 2024-04-24 11:43:00 +03:00
Vadim Nifadev
f84272fc5c Translate All sorted? example 2024-04-24 11:39:29 +03:00
Vadim Nifadev
8f60bc1d0b Translate Wild imports example 2024-04-24 11:35:57 +03:00
Vadim Nifadev
bbb086a521 Translate Splitsies example 2024-04-24 11:27:46 +03:00
Vadim Nifadev
2043112a9d Translate Needles in a haystack example 2024-04-23 12:32:24 +03:00
Vadim Nifadev
0d28d47f08 Translate Rounding like a banker example 2024-04-23 12:18:36 +03:00
Vadim Nifadev
a25fe26adc Translate Name resolution ignoring class scope example 2024-04-23 12:07:47 +03:00
Vadim Nifadev
40503d5ac5 Translate Same operands, different story example 2024-04-23 12:02:54 +03:00
Vadim Nifadev
c2dd151ed5 Translate Catching the Exceptions example 2024-04-23 11:45:32 +03:00
Vadim Nifadev
7ce56da1d8 Translate Beware of default mutable arguments example 2024-04-23 11:39:15 +03:00
Vadim Nifadev
473e4229f2 Translate Loop variables leaking out example 2024-04-23 11:23:47 +03:00
Vadim Nifadev
3df9d0e4e3 Translate Lossy zip of iterators example 2024-04-23 11:07:40 +03:00
Vadim Nifadev
e8cd593e62 Translate Deleting list item while iterating over it example 2024-04-23 10:58:11 +03:00
Vadim Nifadev
2aa7b37540 Translate The out of scope varibale example 2024-04-23 09:02:25 +03:00
Vadim Nifadev
b1a8aadd70 Translate Stubborn operation example 2024-04-23 08:53:40 +03:00
Vadim Nifadev
eccd68a4bd Translate Modifying dictionary while iterating over it example 2024-04-22 15:37:59 +03:00
Vadim Nifadev
3fc9e9e028 Translate Exceeds the linit for integer string conversion example 2024-04-22 15:24:31 +03:00
Vadim Nifadev
c125f25fb5 Translate Let's see if you can guess this? example 2024-04-22 15:19:58 +03:00
Vadim Nifadev
f96f5117c5 Translate The mysterious key type conversion example 2024-04-22 15:08:54 +03:00
Vadim Nifadev
58de881f93 Translate The dissapearing variable from outer scope example 2024-04-22 14:51:49 +03:00
Vadim Nifadev
f2b1d7e8c2 Translate Mutating the immutable! example 2024-04-22 14:33:23 +03:00
Vadim Nifadev
495c840254 Translate Nan-reflexivity example 2024-04-22 14:21:35 +03:00
Vadim Nifadev
51d13b87cf Translate Yielding from... return example 2024-04-22 14:13:11 +03:00
Vadim Nifadev
ecaab6dca1 Translate Yielding None example 2024-04-22 14:05:53 +03:00
Vadim Nifadev
972d1334fb Translate Class attributes and instance atributes example 2024-04-22 14:03:16 +03:00
Vadim Nifadev
a0069d842e Translate What's wrong with booleans? example 2024-04-22 13:58:11 +03:00
Vadim Nifadev
8a1536986f Translate Half triple-quoted strings example 2024-04-22 12:19:28 +03:00
Vadim Nifadev
5eeb1053aa Translate Not knot example 2024-04-22 12:13:13 +03:00
Vadim Nifadev
293575b7c4 Translate String and backslashes example 2024-04-22 12:08:53 +03:00
Vadim Nifadev
191ea8343b Translate The surprising comma example 2024-04-22 12:02:32 +03:00
Vadim Nifadev
6e246d1487 Translate Methods equality and identity example 2024-04-21 10:57:44 +03:00
Vadim Nifadev
a32eaca58f Translate Sublass relationships example 2024-04-21 10:41:17 +03:00
Vadim Nifadev
446a3a09bb Translate Chicken egg problem example 2024-04-21 10:32:21 +03:00
Vadim Nifadev
4576463fcc Translate Schrödinger's variable * example 2024-04-19 15:02:10 +03:00
Vadim Nifadev
361ac5f49b Translate A tic-tac-toe where X wins in the first attempt! example 2024-04-19 14:41:30 +03:00
Vadim Nifadev
497b9de72b Translate is not ...is (not ...) example 2024-04-19 14:31:02 +03:00
Vadim Nifadev
259fb23c7b Translate Evaluation time discrepancy example 2024-04-19 14:27:26 +03:00
Vadim Nifadev
654da92e88 Translate For what? example 2024-04-19 12:43:52 +03:00
Vadim Nifadev
83bdff8e33 Translate Keep trying example 2024-04-19 12:36:33 +03:00
Vadim Nifadev
47fa96c31a Translate Disorder within order example 2024-04-19 12:28:37 +03:00
Vadim Nifadev
2840050acb Translate Hash brownies and Deep down, we're all the same examples 2024-04-19 12:10:22 +03:00
Vadim Nifadev
a7985b9edc Translate How not to use is operator example 2024-04-18 15:08:23 +03:00
Vadim Nifadev
e2d6ee66cc Translate Be careful with chained operations example 2024-04-18 14:45:13 +03:00
Vadim Nifadev
c91a6073fb Translate Strings can be tricky sometimes example to russian 2024-01-30 21:33:44 +03:00
Vadim Nifadev
86140390ad Translate First things first! example to russian 2024-01-25 17:01:26 +03:00
Vadim Nifadev
b5b8b83c0a Translate usage to russian 2024-01-25 16:43:04 +03:00
Vadim Nifadev
489ccb18a7 Translate Structure of the Examples to russian 2024-01-25 16:34:40 +03:00
Vadim Nifadev
57987cc9d5 Translate header to russian
- As discussed with maintainer, create folder for storing translations
It will give more control, everything will be stored in 1 repository
and it eliminates possible deletion or making translation private
2024-01-25 11:19:34 +03:00
Satwik Kansal
86e78697fb
Merge pull request #320 from Sea-n/master
Invert logo color for dark theme
2023-10-08 01:25:20 +05:30
Sean
1b1b9d4b70 Invert logo color for dark theme 2023-10-05 16:20:26 +08:00
Raigorx Hellscream
5e8cfd7dbe
typo: strings-and-the-backslashes 2023-09-01 17:05:04 -04:00
Satwik Kansal
19d4b07515
Merge pull request #314 from raigorx/patch-1
fix: Hashable import
2023-09-01 16:06:23 +05:30
Raigorx Hellscream
ab82f9647c
Update README.md
https://docs.python.org/3/library/collections.abc.html#collections.abc.Hashable
2023-08-31 17:49:04 -04:00
Satwik Kansal
f32e9d36e3
Merge pull request #312 from franciscouzo/master
Fix typo
2023-08-28 01:24:50 +05:30
Satwik Kansal
6010b97d90
Add link to Germany translation 2023-08-28 01:24:20 +05:30
Francisco Couzo
acfcfa8808 Fix typo 2023-08-27 14:32:48 +00:00
Satwik Kansal
ccf5be1a6f
Update README.md 2023-04-28 12:34:28 +05:30
Satwik Kansal
a50839656c
Update README.md 2023-02-26 12:14:52 +05:30
Satwik Kansal
f5f5208b12
Merge pull request #243 from vitorsrg/change/no-char-datatype
Improve string indexing result explanation
2022-12-05 09:17:50 +05:30
Satwik Kansal
ea1e228407
Merge pull request #300 from frontdevops/patch-2
Update README.md
2022-11-01 14:51:09 +05:30
Alexander Mayorov
d8258dbc96
Update README.md
Add new feature: Exceeds the limit for integer string conversion
2022-10-22 00:00:55 +04:00
Satwik Kansal
6a4cd34413
Merge pull request #299 from frontdevops/patch-1
Update README.md, Added a link to the Russian version
2022-09-18 19:40:01 +05:30
Alexander Mayorov
feeb410009
Update README.md 2022-09-17 21:13:35 +04:00
Satwik Kansal
6213399144
Merge pull request #292 from jeffreykennethli/master
Update link and add parenthesis to chained operators section
2022-06-03 19:49:29 +05:30
jeffreykennethli
d3a25fa14e Update link and add parenthesis to chained operators section 2022-06-03 10:15:21 -04:00
Satwik Kansal
e9a49a5527
Merge pull request #290 from mattkohl-flex/master
Update README.md
2022-06-01 09:07:06 +05:30
Matt Kohl
be377779b6
Update README.md
Grammatical fix
2022-05-31 15:36:12 +01:00
Satwik Kansal
fe9ed47217
Update Spanish translation link 2022-05-11 22:27:47 +05:30
Satwik Kansal
00c5503712
Update link to Chinese translation 2022-04-04 16:02:41 +05:30
Satwik Kansal
cd4d7c0e34
Update README.md 2022-01-18 00:00:02 +05:30
Satwik Kansal
c8f300fd09
Merge pull request #277 from fluencydoc/trelent-documentation
Added docstrings to several undocumented functions
2021-12-23 12:51:30 +05:30
flencydoc
205c9ede01 Added docstrings to several undocumented functions. 2021-12-23 03:53:28 +00:00
Satwik Kansal
f4f501a230
Merge pull request #276 from bwduncan/patch-1
Minor README fixups
2021-10-30 22:56:15 +05:30
bwduncan
043b83a722
Minor README fixups 2021-10-29 20:52:07 +01:00
Satwik Kansal
2e2d65a9ec
Add reference to Korean translation and fix a typo
Closes https://github.com/satwikkansal/wtfpython/issues/271
2021-08-09 18:13:25 +05:30
Satwik Kansal
086be4ed19
Update CONTRIBUTING.md 2021-05-12 00:19:21 +05:30
Satwik Kansal
9fc6db6215
Minor formatting fix 2021-05-11 02:04:55 +05:30
Satwik Kansal
897b915f11
Merge pull request #268 from LiquidFun/master
Add new snippet: banker's rounding
2021-05-11 02:03:45 +05:30
LiquidFun
6642876c64 Add new snippet: banker's rounding
Closes #267
2021-05-10 00:25:26 +02:00
Satwik Kansal
b89710a415
Merge pull request #266 from sonlhcsuit/master
Fix small typo
2021-04-28 15:24:45 +05:30
sonlhcsuit
aaa74c46a7 fixthings up 2021-04-28 16:10:51 +07:00
Satwik Kansal
1787b50422
Merge pull request #264 from Nucaranlaeg/patch-1
Fix small typo
2021-04-09 16:58:51 +05:30
Sam Benner
5525591601
Fix small typo 2021-04-07 18:46:23 -05:00
Satwik Kansal
bfccb718de
Merge pull request #260 from JoseDeFreitas/add-spanish-translation
Add Spanish translation
2021-02-25 07:13:24 +00:00
José De Freitas
95a87484c5
Add myself as contributors 2021-02-24 19:50:43 -05:00
José De Freitas
6e187cf84b
Add Spanish translation reference 2021-02-24 19:49:05 -05:00
Satwik Kansal
d6ba3a66a3
Merge pull request #256 from chrismilson/all-true-ation-readability
Update explanation for All-true-ation
2021-02-18 12:53:58 +00:00
Chris Milson
f0bd1cb481 Update explanation for All-true-ation
#255
2021-02-18 19:05:40 +09:00
Satwik Kansal
70c03e9801
Merge pull request #254 from umutambyi-gad/master
📝 Fixed simple typos
2021-02-14 05:26:35 +00:00
Umutambyi Gad
9d0ad9ed98
📝 Fixed simple typos 2021-02-14 00:55:41 +01:00
Satwik Kansal
48256e1fe8
Merge pull request #247 from abdnh/patch-1
Fix typo
2021-02-03 07:24:33 +00:00
abdo
de4b851c72
Fix typo
getclosurevals -> getclosurevars
2021-02-03 02:01:07 +03:00
Satwik
048a620502 Update notebook 2021-01-17 13:56:41 +05:30
Satwik
2bc1cd61c1 Update the sticy output example
Closes https://github.com/satwikkansal/wtfpython/issues/245
2021-01-17 13:55:35 +05:30
Vitor Santa Rosa
d06fcbff1b
Improve string indexing result explanation 2020-11-28 23:25:16 -03:00
Satwik Kansal
c954b71f67
Merge pull request #241 from Jongy/methods
Add section on methods equality and identity
2020-11-08 11:03:34 +05:30
Yonatan Goldschmidt
314de9a30b Merge "Non-reflexive class method" into new example 2020-11-08 01:41:59 +02:00
Yonatan Goldschmidt
f13b98e6d5 Add section on methods equality and identity
Closes: #233
2020-11-05 01:11:18 +02:00
Satwik Kansal
902ca179eb
Merge pull request #235 from imba-tjd/patch-1
Change Py2 docs to 3
2020-10-27 13:54:16 +05:30
Satwik Kansal
9c42b920ad
Merge pull request #236 from imba-tjd/patch-2
Use https links
2020-10-27 13:53:30 +05:30
Satwik Kansal
bb8ce63f68
Merge pull request #237 from imba-tjd/patch-3
fix indentation
2020-10-27 13:50:27 +05:30
谭九鼎
ac63a4fb3a
fix indentation 2020-10-27 12:19:37 +08:00
谭九鼎
c824ed7813
Update README.md 2020-10-27 11:10:44 +08:00
谭九鼎
e5b519149d
Use https links 2020-10-27 11:10:03 +08:00
谭九鼎
435fd5f49e
Change Py2 docs to 3 2020-10-27 11:07:47 +08:00
Satwik Kansal
f082e9f22a
Update README.md 2020-10-24 21:57:35 +05:30
Satwik Kansal
33bcfa744a
Minor changes to nonlocal explanation
Closes https://github.com/satwikkansal/wtfpython/issues/193
2020-10-05 20:42:16 +05:30
Diptangsu Goswami
7525e800b8
#193 The out of scope variable, nonlocal (#228)
* fixed link to CONTRIBUTORS.md

* The out of scope variable, nonlocal, #193

* added myself to CONTRIBUTORS.md :D

* Update CONTRIBUTORS.md

* added entry in index

* merged nonlocal to `the out of scope variable` example

Also removed the extra entry from the main index.
2020-10-05 20:35:20 +05:30
Satwik Kansal
9b3f86958a
Merge pull request #227 from amitShindeGit/patch-1
Update README.md
2020-10-01 20:13:07 +05:30
AmitShinde
d4ad5a0643
Update README.md 2020-10-01 19:41:25 +05:30
Satwik Kansal
9e28e00123
Update CONTRIBUTING.md 2020-10-01 16:56:40 +05:30
Satwik Kansal
27b66b4f31
Fix typo and minor changes 2020-09-17 17:02:56 +05:30
Satwik Kansal
19e6b7da57
Merge pull request #221 from cl0ne/patch-1
Add link to Python FAQ to "Mutating the immutable"
2020-09-17 07:39:11 +05:30
Vladislav Glinsky
be2d537a05
Add link to Python FAQ to "Mutating the immutable" 2020-09-17 03:38:41 +03:00
Satwik
7d06e7b5c1 Add a meme 2020-08-27 00:47:08 +05:30
Satwik Kansal
a3baf043bd
Add a note about the asterisks
Fixes https://github.com/satwikkansal/wtfpython/issues/219
2020-08-24 20:10:59 +05:30
Satwik Kansal
03a035a89d
Merge pull request #216 from Jongy/instance-dict-size
Add "bloating instance dicts" section
2020-08-01 17:54:21 +05:30
Yonatan Goldschmidt
87906b9b2f Fix anchor name of "slowing down dict lookups" 2020-07-31 12:34:12 +03:00
Yonatan Goldschmidt
ee0696b676 Add "bloating instance dicts" section
Closes: #210
2020-07-31 12:34:12 +03:00
Satwik
f72d7325fa Fix uuid and toc 2020-07-10 22:34:22 +05:30
Satwik
ee70d52fe4 Add Jongy to the contributors list 2020-07-10 22:30:30 +05:30
Satwik
f97cbdd919 Minor updates to slowinig down dict lookups example 2020-07-10 22:28:44 +05:30
Satwik Kansal
098d71f348
Merge pull request #209 from Jongy/dict-loopup-performance
Add "dict lookup performance" section
2020-07-10 22:17:41 +05:30
Yonatan Goldschmidt
0b74f9ba5d Add "dict lookup performance" section
Closes: #208
2020-07-04 18:45:45 +03:00
Satwik Kansal
7457ffb848
Update README.md 2020-06-25 16:28:58 +05:30
Satwik
3ba87fea65 Add link 2020-06-15 16:03:06 +05:30
Satwik
32f14a7e16 Add Vietnamese translation
Closes https://github.com/satwikkansal/wtfpython/issues/195
2020-06-14 10:40:30 +05:30
Satwik Kansal
14600fd19b
Merge pull request #204 from myrmica-habilis/master
Add two missing outputs in the walrus examples
2020-05-16 17:57:52 +05:30
Satwik Kansal
5edef33cae
Merge pull request #203 from secworks/master
'less than 21' is the correct expression.
2020-05-02 21:50:04 +05:30
Joachim Strömbergson
9ff40de544
'less than 21' is the correct expression. Could slso be 'less or equal to 20'. 2020-05-02 08:54:24 +02:00
Satwik Kansal
0684777fa3
Merge pull request #199 from LeafyLi/master
Replace http link with https
2020-04-26 23:38:43 +05:30
zenglifa@msu.edu
f735fe3116 Replace http link with https 2020-04-25 15:37:50 -04:00
Satwik Kansal
669ff8c30e
Merge pull request #192 from Jongy/correctify-stubborn-del-explanation
Correctify explanation of "Stubborn `del` operation"
2020-03-25 22:40:42 +05:30
Yonatan Goldschmidt
67f743eddd Correctify explanation of Stubborn del operation 2020-03-24 23:12:47 +02:00
myrmica-habilis
78cb5f39f5 Update README.md
- assignment expressions are evaluated and printed by the REPL
2020-03-20 11:00:29 +01:00
Satwik Kansal
e9b04d33f7
Merge pull request #181 from Haksell/correct-six-typos
Correct six typos
2020-02-16 02:31:40 +05:30
Satwik Kansal
733061f90d
Merge pull request #183 from Pradhvan/UpdatingDoc
README.md: Update Python version in 'Modifying a dictionary while ite…
2020-02-15 14:35:55 +05:30
Pradhvan
184df9f99d README.md: Update Python version in 'Modifying a dictionary while iterating over it' example 2020-02-15 14:30:05 +05:30
Haksell
a4af8a4e0c Correct six typos 2020-02-15 09:04:24 +01:00
Haksell
50265e91fc Correct six typos 2020-02-15 09:03:08 +01:00
Satwik Kansal
6cebc952c3
Fix minor typo in the "is not" example 2020-01-20 14:23:20 +05:30
Satwik Kansal
bd7cd4334c
Merge pull request #175 from larsks/fix/is-not
Extend the explanation of the "is not ..." section
2020-01-20 14:20:57 +05:30
Satwik Kansal
97c10e6fda
Merge pull request #177 from larsks/fix/quotes
Clarify for quoting examples
2020-01-20 14:20:22 +05:30
Satwik Kansal
8e6c850f30
Merge pull request #178 from larsks/fix/bad-logic
Fixed logic error in "Beware of default mutable arguments!"
2020-01-20 14:18:41 +05:30
Satwik Kansal
e74ccb79d0
Merge pull request #176 from larsks/fix/grammar
A minor grammar correction
2020-01-20 14:17:48 +05:30
Satwik Kansal
daf156abf5
Merge pull request #174 from larsks/spelling
Fix spelling (found -> find)
2020-01-20 14:13:23 +05:30
Lars Kellogg-Stedman
16c90f9b24 Fixed logic error in "Beware of default mutable arguments!"
The example showing how using None as a default argument is used
instead of a mutable default argument had reversed logic.  It would
set default_arg to [] whenever the caller passed a non-None argument.
2020-01-19 12:03:30 -05:00
Lars Kellogg-Stedman
3e99005ae4 Clarify for quoting examples
The example of the use of backslash to escape a double-quote makes
more sense when used inside a double-quoted string. If the string is
quoted with single quotes, one could of course just write 'wt"f'
withouth requiring any escaping.
2020-01-19 10:19:17 -05:00
Lars Kellogg-Stedman
8370f3a3b9 A minor grammar correction 2020-01-19 10:16:47 -05:00
Lars Kellogg-Stedman
f20be4cfc4 Extend the explanation of the "is not ..." section
I thought that the explanation for "'something' is (not None)" could
be a little more explicit.
2020-01-19 10:13:50 -05:00
Lars Kellogg-Stedman
00a1228ca3 Fix spelling (found -> find)
Noticed a minor spelling error while reading through this fantastic
document.
2020-01-19 10:04:41 -05:00
Satwik Kansal
de113d2491
Merge pull request #170 from art049/master
Wild imports typo
2020-01-12 00:34:12 +05:30
Satwik Kansal
ffb1599458
Merge pull request #171 from entwanne/needles-haystack-example-6
Fix explanation for 6th example of "Needles in a Haystack"
2020-01-12 00:33:30 +05:30
Antoine Rozo
5f8067df42 Fix explanation for 6th example of "Needles in a Haystack" 2020-01-10 14:39:29 +01:00
Arthur Pastel
30a6623ccd
Wild imports typo 2020-01-10 12:43:16 +01:00
Satwik Kansal
83cac75f41
Merge pull request #169 from kerolloz/master
Fix issue creating link
2020-01-10 14:40:07 +05:30
Kerollos Magdy
d1a4144143
Fix issue creating link 2020-01-09 13:12:14 +02:00
Satwik Kansal
3e98cf1ceb
Merge pull request #168 from chrisguox/update-docs
Fixed example input error
2020-01-09 14:50:47 +05:30
Chris Guo
43679ebd1e fix: fix example input error 2020-01-08 00:09:25 +08:00
Satwik Kansal
0d65c00bb6
Merge pull request #166 from louisguitton/patch-1
Fix typo in 'Strings can be tricky sometimes'
2020-01-06 19:39:21 +05:30
Satwik Kansal
255b9a574b
Merge pull request #167 from OdinTech3/patch-1
Fixed mispelling
2020-01-06 19:38:49 +05:30
Nick Muoh
68f6e0217c
Fixed mispelling 2020-01-04 19:49:32 -05:00
Louis Guitton
3d64252310
Fix typo in 'Strings can be tricky sometimes' 2020-01-04 17:16:09 +01:00
Satwik
185d60c1b6 Update hash brownies explanation and the logical order of few examples.
Addresses https://github.com/satwikkansal/wtfpython/pull/76
2019-12-31 16:10:45 +05:30
Satwik Kansal
1b3b2e6c71
Fix typo
Closes https://github.com/satwikkansal/wtfpython/issues/165
2019-12-30 19:20:31 +05:30
Satwik Kansal
f98bd4363f
Fix typo
Closes https://github.com/satwikkansal/wtfpython/issues/164
2019-12-30 13:05:38 +05:30
Satwik
2c910351b7 Fix relevant typos detected by codespell
Closes https://github.com/satwikkansal/wtfpython/issues/161
2019-12-27 20:05:17 +05:30
Satwik
9a2718ae3a Fix typo
Closes https://github.com/satwikkansal/wtfpython/issues/162
2019-12-27 20:05:17 +05:30
Satwik Kansal
183e0d9ee5
Merge pull request #160 from vrthra/patch-1
Make sure that default_arg is not passed rather than checking for fal…
2019-12-25 19:21:24 +05:30
Rahul Gopinath
2f2fcf87bc
Make sure that default_arg is not passed rather than checking for falsity
```
if not default_arg:
    ...
```
fails when `default_arg` can be assigned and still be false (implementing a `__bool__` or `__len__` etc). You dont want to overwrite the passed values.
2019-12-25 10:10:53 +01:00
Satwik Kansal
99280f57a0
Merge pull request #159 from boppreh/patch-1
Update README.md
2019-12-25 01:23:18 +05:30
Satwik
7c85a73442 Move discussion thread links to the links section 2019-12-25 00:09:55 +05:30
BoppreH
e4f340281c
Update README.md
Fix incorrect output for f-string.
2019-12-24 14:02:22 -03:00
Satwik
6c0ed6e7c5 Add discussion links 2019-12-24 21:47:59 +05:30
Satwik
dcc2e6a3d8 Update links 2019-12-24 20:09:12 +05:30
Satwik
a1b4f8d521 Put the pdf link back on demand 2019-12-23 23:13:08 +05:30
Satwik Kansal
328168c86f
Merge pull request #158 from rscircus/patch-1
Fix typo in dictionary section
2019-12-23 21:25:38 +05:30
puɐloɹ ʇɹǝqƃǝᴉs
73a1248d04
Fix typo in dictionary section 2019-12-23 16:31:44 +01:00
Satwik
a39792bd4b Remove kofi link 2019-12-23 16:27:27 +05:30
Satwik
bd45175405 Point colab notebook to the master 2019-12-23 15:59:59 +05:30
Satwik
438f52c3e9 Update notebook with recent changes 2019-12-23 15:58:49 +05:30
Satwik
b3387c9dc7 Add indent to the dump for better diff 2019-12-23 15:58:25 +05:30
Satwik Kansal
ad39ef8625
Merge pull request #155 from yaph/patch-1
Make hashtags in Twitter link work
2019-12-23 15:33:22 +05:30
Satwik Kansal
df8baf9941
Merge pull request #157 from saveriomiroddi/sav-correct_typos
Correct some typos
2019-12-23 15:32:32 +05:30
Saverio Miroddi
e35642ed05 Correct some typos
Corrected a handful of typos.
2019-12-23 10:31:40 +01:00
Ramiro Gómez
f8aa17c8ba
Make hashtags in Twitter link work
Change URL parameter from `hastags` to  `hashtags`.
2019-12-22 21:11:25 +01:00
Satwik Kansal
b8e4cd1693
Merge pull request #154 from satwikkansal/3.0
🎉
2019-12-21 22:38:00 +05:30
Satwik
76d98d9138 Fix line break 2019-12-21 22:12:56 +05:30
Satwik
d59db75b4c Add link to other modes 2019-12-21 22:11:55 +05:30
Satwik
734360ff59 Add team trees 2019-12-21 20:38:18 +05:30
Satwik
2fb14be424 Update the notebook 2019-12-21 20:06:48 +05:30
Satwik
483496d97a Aesthetical changes 2019-12-21 20:00:21 +05:30
Satwik
f914194a87 Add instructions 2019-12-21 19:39:49 +05:30
Satwik
12b2fc008e Fix TOC and links 2019-12-21 19:39:28 +05:30
Satwik
1b1a5bc10d Add generated notebook 2019-12-21 00:16:34 +05:30
Satwik
49ed35e099 Add hosted notebook instructions 2019-12-21 00:16:19 +05:30
Satwik
56c0347dd1 Minor correction 2019-12-20 23:56:35 +05:30
Satwik
7006084c12 Fix URLs 2019-12-20 23:39:10 +05:30
Satwik
a9cbcdd95a Rename json_generator to notebook_generator 2019-12-20 23:27:25 +05:30
Satwik
9fb381c4f3 Fix soo many typos, sigh. 2019-12-20 02:05:53 +05:30
Satwik
264b93a633 Remove every existence of npm 2019-12-20 01:28:49 +05:30
Satwik
a7471ca737 Merge branch 'master' into 3.0 2019-12-20 01:26:14 +05:30
Satwik
6e5278e30a More cleanup and another version bump 2019-12-20 01:25:00 +05:30
Satwik
8e798af4fc Ignore IDE files and Bump npm version 2019-12-20 01:25:00 +05:30
Satwik
176bcc8a25 Bump npm version 2019-12-20 01:25:00 +05:30
Satwik
44e885a09c Ignore unnecessary stuff in npm package 2019-12-20 01:25:00 +05:30
Satwik
dd3c62d49d Remove npm related stuff 2019-12-20 01:14:09 +05:30
Satwik
68904d3f6f Remove mention of npm package 2019-12-20 01:13:18 +05:30
Satwik
f30181a54e Merge remote-tracking branch 'origin/master' into 3.0 2019-12-20 00:52:52 +05:30
Satwik
0c461ee66a Ignore IDE files 2019-12-20 00:36:19 +05:30
Satwik
b96e2fb6a9 Respect the read_only rule 2019-12-20 00:31:42 +05:30
Satwik Kansal
2f383f8dc0
Merge pull request #152 from sobolevn/patch-2
Adds wemake-python-styleguide
2019-12-20 00:29:59 +05:30
Satwik
ef68d1b482 Add markers for new content 2019-12-20 00:27:21 +05:30
Satwik
8522964105 Read only meta tag, and minor fixes 2019-12-19 21:47:20 +05:30
Satwik
f3c7afebd7 Minor corrections 2019-12-19 15:49:52 +05:30
Satwik
d7c8b73731 Remove lobby link 2019-12-19 15:49:40 +05:30
Nikita Sobolev
e899e38553
Adds wemake-python-styleguide
Link: https://github.com/wemake-services/wemake-python-styleguide
Docs: https://wemake-python-stylegui.de/en/latest/
2019-12-01 15:51:18 +03:00
Satwik
d9e71224e2 Add minor example 2019-11-07 17:27:52 +05:30
Satwik
65c8a9ef8c Update contributors list. 2019-11-04 23:19:13 +05:30
Satwik
888c9e1261 Fix indenting, add a minor example, and update contributing message 2019-11-04 23:18:52 +05:30
Satwik
e18e56eba3 Working experimental notebook generator 2019-11-03 00:54:27 +05:30
Satwik
2cd7e3fccd Fix broken links 2019-11-03 00:54:04 +05:30
Satwik
2161c48e8e Parse nested examples 2019-11-02 23:25:58 +05:30
Satwik
321e7196d0 Some change of example orders 2019-11-02 23:02:47 +05:30
Satwik
08302ba0c8 Ignore environment and checkpoint files 2019-10-31 23:51:47 +05:30
Satwik
2160dad717 Use dynamic path instead of fixed one 2019-10-31 23:50:50 +05:30
Satwik
a553ea0070 Some meta tags and corrections after running on Python 3.8 2019-10-31 23:50:23 +05:30
Satwik
d4021862f0 Add no longer working note. 2019-10-31 01:07:04 +05:30
Satwik
1d467287ef Move stuff to obsolete package.
Not deleting it for quick future reference for contributors and myself.
2019-10-31 01:05:23 +05:30
Satwik
0160d5019b Remove un-necessary file 2019-10-31 01:01:45 +05:30
Satwik
a5593c42e0 Update comments 2019-10-31 00:59:57 +05:30
Satwik
7df49cd818 Change section name to Slippery Slopes and modify nan-reflexivity example 2019-10-31 00:51:48 +05:30
Satwik
af6d1799d9 Add more details to compile time optimisation snippets. 2019-10-30 23:24:07 +05:30
Satwik
5bf46f66af Bring compiler optimisation stuff back, and add minor updates. 2019-10-30 23:04:50 +05:30
Satwik
312c5d542c Add non reflexive class method and the matmul operator examples 2019-10-30 01:03:07 +05:30
Satwik
4af4f9debf Add more examples 2019-10-29 23:53:42 +05:30
Satwik
b10b3ad346 Add another needle-like example
Closes https://github.com/satwikkansal/wtfpython/issues/137
2019-10-29 22:31:58 +05:30
Satwik
133baac11c Add minor snippet related to output buffer flushing
Closes https://github.com/satwikkansal/wtfpython/issues/140
2019-10-29 22:31:58 +05:30
Satwik
34e97d53fb Add example related to the Walrus operator
Closes https://github.com/satwikkansal/wtfpython/issues/145
2019-10-29 01:07:28 +05:30
Satwik
bd798f2966 Update alignment 2019-10-28 22:51:03 +05:30
Satwik
ce8adb0417 Update TOC 2019-10-28 22:48:15 +05:30
Satwik
28bcbfd311 More changes to order and aesthetics 2019-10-28 22:40:32 +05:30
Satwik
82c37ccb32 Perhaps some editing 2019-10-28 22:17:26 +05:30
Satwik
43355e2498 Merge branch 'master' into 3.0 2019-10-28 19:34:20 +05:30
Satwik
45a2cb5ddd Merge remote-tracking branch 'origin/3.0' into 3.0 2019-10-28 19:30:53 +05:30
Satwik
d823aa9220 Ignore DS_Store 2019-10-28 19:23:06 +05:30
Satwik Kansal
8135cbb99c
README.md Fix typos 2019-10-25 19:52:52 +05:30
monujee
bef3f2a33d
Update README.md
Typo corrected.
2019-10-25 14:28:25 +05:30
Satwik Kansal
f8acf49d05
Update README.md 2019-10-09 18:48:41 +05:30
Satwik Kansal
88ccda2bcd
Merge pull request #141 from mitcom/space-invader-operator
Add space-invader operator case
2019-10-09 18:43:28 +05:30
mitcom
d143f972b8 Add space-invader operator case 2019-10-06 13:12:35 +02:00
Satwik Kansal
fc491c5dd6 Commit insert_ids script 2019-09-13 15:25:57 +05:30
Satwik Kansal
6223715725 change order 2019-09-13 15:25:57 +05:30
Satwik Kansal
2a1c28ee4d Fix toc 2019-09-13 15:25:57 +05:30
Satwik Kansal
d6b735768c Remove asterisks and carets from titles 2019-09-13 15:24:43 +05:30
Satwik Kansal
e8fcce27c2 Fix uuid comments 2019-09-13 15:24:01 +05:30
Satwik Kansal
45638fa6b1 Add uuids to examples 2019-09-13 15:24:01 +05:30
Satwik Kansal
162458c88e Update TOC 2019-09-13 15:24:01 +05:30
Satwik Kansal
edeb98f406 Update the booleans example
Fix some technically incorrect terminologies and snippets.
2019-09-13 15:22:40 +05:30
Satwik Kansal
9939ff6a1f Add new example: Wild imports 2019-09-13 15:22:40 +05:30
Satwik Kansal
6934d94222 Some minor changes, and add assertion example 2019-09-13 15:22:01 +05:30
Satwik Kansal
7b22f84f97 Add new example: Disorder within order
Resolves https://github.com/satwikkansal/wtfpython/issues/77
2019-09-13 15:21:05 +05:30
Satwik Kansal
055bd0246d New example: Lossy zip of iterators
Resolves https://github.com/satwikkansal/wtfpython/issues/121
2019-09-13 15:21:05 +05:30
Satwik Kansal
330f7da1d3 String can be tricky: Remove outdated snippet
Related to https://github.com/satwikkansal/wtfpython/issues/120
2019-09-13 15:21:05 +05:30
Satwik Kansal
ae05101d70 Brace yourself: Add to explanation
Resolves https://github.com/satwikkansal/wtfpython/issues/114
2019-09-13 15:18:48 +05:30
Satwik Kansal
2295fb24b7 Let's make a giant string: Use %timeit for measuring time
Fixes https://github.com/satwikkansal/wtfpython/issues/106
2019-09-13 15:18:48 +05:30
Satwik Kansal
f365271df3 New example: The chicken-egg problem
Closes https://github.com/satwikkansal/wtfpython/issues/101
2019-09-13 15:18:48 +05:30
Satwik Kansal
9b3b367b45 Update example "is is not what it is"
Related to https://github.com/satwikkansal/wtfpython/issues/100
2019-09-13 15:18:48 +05:30
Satwik Kansal
5373d0f184 Add example: Ellipsis
Resolves https://github.com/satwikkansal/wtfpython/issues/96
2019-09-13 15:18:48 +05:30
Satwik Kansal
89c56c2366 Let's meet Friendly Language Uncle For Life: Add notes for non-interactive evn
Resolves https://github.com/satwikkansal/wtfpython/issues/94
2019-09-13 15:18:48 +05:30
Satwik Kansal
e3118ed4da Add new snippet: Splitsies
Resolves https://github.com/satwikkansal/wtfpython/issues/80
2019-09-13 15:18:48 +05:30
Satwik Kansal
f3b96e4d7f Expand strings and backslashes
Resolves https://github.com/satwikkansal/wtfpython/issues/69
2019-09-13 15:18:48 +05:30
Satwik Kansal
a0832c4459 Modifying a dictionary while iterating over it: Add note
Resolves https://github.com/satwikkansal/wtfpython/issues/53
2019-09-13 15:18:48 +05:30
Satwik Kansal
dbbabbe564 Update evaluation time discrepency example: Add another snippet
Resolves https://github.com/satwikkansal/wtfpython/issues/41
2019-09-13 15:18:48 +05:30
Satwik Kansal
f8a7d38b70 Update content.md 2019-09-13 15:18:47 +05:30
Satwik Kansal
810dbe1582 Some hideous typora corrections and a new snippets added
Also closes https://github.com/satwikkansal/wtfpython/issues/73
2019-09-13 15:18:47 +05:30
Satwik Kansal
a5e7cd7cf8 Add todos 2019-09-13 15:18:47 +05:30
Satwik Kansal
efdac8f9ca Get the generator in a working state 2019-09-13 15:18:47 +05:30
Satwik Kansal
3479b2befb Use absolute path for the pager.
Fixes https://github.com/satwikkansal/wtfpython/issues/119
2019-09-13 15:18:47 +05:30
Satwik Kansal
290921fe12 Add json generator 2019-09-13 15:16:18 +05:30
Satwik
03719dea45 Add few pointers for contributing well 2019-09-13 15:15:31 +05:30
Satwik
c5665da81d Nitpicks in the new example 2019-09-13 15:01:45 +05:30
Satwik Kansal
0fa3067e5f
Merge pull request #138 from scidam/master
New snippet: yielding from... return!
2019-09-13 14:33:20 +05:30
Kislov Dmitry
cedbfba829 New snippet: yielding from... return! 2019-09-13 12:03:27 +10:00
Satwik Kansal
9f5dbbe4e9
Merge pull request #134 from sobolevn/patch-1
Fixes code highlight
2019-08-04 12:56:24 +05:30
Nikita Sobolev
b0622a10ad
Fixes code highlight 2019-07-30 00:34:58 +03:00
Satwik Kansal
ffe6438576 Commit insert_ids script 2019-07-21 18:57:01 +05:30
Satwik Kansal
772a96c36f change order 2019-07-13 22:41:27 +05:30
Satwik Kansal
d3157d61a3 Fix toc 2019-07-08 22:24:37 +05:30
Satwik Kansal
4618bed5f6 Remove asterisks and carets from titles 2019-07-08 22:01:41 +05:30
Satwik Kansal
863e1f4512 Fix uuid comments 2019-07-08 03:00:33 +05:30
Satwik Kansal
98701351c6 Add uuids to examples 2019-07-08 02:54:49 +05:30
Satwik Kansal
c30e0d2ed6 Merge remote-tracking branch 'origin/master' into 3.0 2019-07-08 02:33:38 +05:30
Satwik Kansal
4d8e5795a3 Update TOC 2019-07-07 22:18:35 +05:30
Satwik Kansal
96455422ef Update the booleans example
Fix some technically incorrect terminologies and snippets.
2019-07-07 22:17:33 +05:30
Satwik Kansal
e6eac17ef5
Merge pull request #126 from cclauss/patch-2
Use ==/!= to compare str, bytes, and int literals
2019-07-06 13:34:28 +05:30
Satwik Kansal
151d0ec93a
Merge pull request #127 from zachkirsch/patch-1
Fix typos in README.md, CONTRIBUTORS.md
2019-07-03 22:29:39 +05:30
Zach Kirsch
12a1ac10cb Fix github URL typos in CONTRIBUTORS.md 2019-07-03 11:46:31 -04:00
zachkirsch
e611f24e7f
Change constant-folding max from <20 to <=20 2019-07-03 11:39:57 -04:00
cclauss
a4776a6b67
Use ==/!= to compare str, bytes, and int literals
Identity is not the same thing as equality in Python.

$ __[flake8](http://flake8.pycqa.org)  . --count --select=E9,F63,F7,F82 --show-source --statistics__
```
    if resp.status_code is 200:
       ^
1     F632 use ==/!= to compare str, bytes, and int literals
1
```
2019-07-02 15:36:23 +02:00
Satwik Kansal
a83349d0cc
Merge pull request #124 from cclauss/patch-1
Add automated testing using Travis CI
2019-07-02 17:45:11 +05:30
cclauss
14e03a3766
Add automated testing using Travis CI
The repo switch would need to be turned on at https://travis-ci.com/satwikkansal/wtfpython to enable free automated testing of all code changes.
2019-06-28 07:03:12 +02:00
Satwik Kansal
8b4bbb2196 Add new example: Wild imports 2019-06-11 00:43:32 +05:30
Satwik Kansal
c6e0d795ff Some minor changes, and add assertion example 2019-06-10 23:22:08 +05:30
Satwik Kansal
362447a5d2 Add new example: Disorder within order
Resolves https://github.com/satwikkansal/wtfpython/issues/77
2019-06-10 00:14:01 +05:30
Satwik Kansal
4d5a2f0d97 New example: Lossy zip of iterators
Resolves https://github.com/satwikkansal/wtfpython/issues/121
2019-06-09 19:45:13 +05:30
Satwik Kansal
bf967b0332 String can be tricky: Remove outdated snippet
Related to https://github.com/satwikkansal/wtfpython/issues/120
2019-06-09 17:56:36 +05:30
Satwik Kansal
80a969a556 Brace yourself: Add to explanation
Resolves https://github.com/satwikkansal/wtfpython/issues/114
2019-06-09 17:34:50 +05:30
Satwik Kansal
2bfa6d2e5b Let's make a giant string: Use %timeit for measuring time
Fixes https://github.com/satwikkansal/wtfpython/issues/106
2019-06-09 03:59:09 +05:30
Satwik Kansal
9ea7ab0c5a New example: The chicken-egg problem
Closes https://github.com/satwikkansal/wtfpython/issues/101
2019-06-09 00:07:02 +05:30
Satwik Kansal
72e39d3248 Update example "is is not what it is"
Related to https://github.com/satwikkansal/wtfpython/issues/100
2019-06-08 23:25:37 +05:30
Satwik Kansal
6164ce065d Merge remote-tracking branch 'origin/master' into 3.0 2019-06-08 22:41:05 +05:30
Satwik Kansal
85352fc45d Add example: Ellipsis
Resolves https://github.com/satwikkansal/wtfpython/issues/96
2019-06-08 16:30:53 +05:30
Satwik Kansal
a33f715b26 Let's meet Friendly Language Uncle For Life: Add notes for non-interactive evn
Resolves https://github.com/satwikkansal/wtfpython/issues/94
2019-06-08 14:49:59 +05:30
Satwik Kansal
c52919b9ec Add new snippet: Splitsies
Resolves https://github.com/satwikkansal/wtfpython/issues/80
2019-06-08 14:21:22 +05:30
Satwik Kansal
092dd096bf Expand strings and backslashes
Resolves https://github.com/satwikkansal/wtfpython/issues/69
2019-06-08 02:53:53 +05:30
Satwik Kansal
e0cb30bf3b Modifying a dictionary while iterating over it: Add note
Resolves https://github.com/satwikkansal/wtfpython/issues/53
2019-06-08 00:41:58 +05:30
Satwik Kansal
bc68ae0ff3 Update evaluation time discrepency example: Add another snippet
Resolves https://github.com/satwikkansal/wtfpython/issues/41
2019-06-08 00:23:57 +05:30
Satwik Kansal
3806284f78 Update content.md 2019-06-07 23:59:19 +05:30
Satwik Kansal
f03f7dcad9 Some hideous typora corrections and a new snippets added
Also closes https://github.com/satwikkansal/wtfpython/issues/73
2019-06-07 23:59:06 +05:30
hippie
31dcd9b062 add encoding (#122)
if not set encoding attr,there maybe have some exceptions when open reading.
2019-06-06 23:45:34 +05:30
Satwik Kansal
45bec627d1 Add todos 2019-05-06 23:49:57 +05:30
Satwik Kansal
5c8c4c5843 Get the generator in a working state 2019-05-06 23:47:24 +05:30
Satwik Kansal
c475cbfe82 Use absolute path for the pager.
Fixes https://github.com/satwikkansal/wtfpython/issues/119
2019-05-01 19:55:46 +05:30
Satwik Kansal
596186d81c Add json generator 2019-05-01 19:12:17 +05:30
Satwik Kansal
54883f5134
Use http instead of https
This will avoid CERTIFICATE_VERIFY_FAILED errors due to SSL.
2019-03-31 19:08:19 +05:30
Satwik Kansal
b262f29756
Add reference to chinese translation 2018-12-16 16:23:39 +05:30
kyblockstacking
30e05a5973 Rephrase sentence to make more sense (#109) 2018-12-09 20:23:28 +05:30
1f604
64b310953a fix typo (#107) 2018-12-07 00:24:45 +05:30
Hannes
9c5f26e758 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.
2018-12-06 01:20:17 +05:30
Hannes
b0e7a816ec make the function *call* more visible (#104)
It is easy to overlook the () in that appending operation, I propose adding a short comment.
2018-12-06 01:15:59 +05:30
Satwik Kansal
d7477885b8
Update broken link 2018-12-05 04:16:32 +05:30
Chris J
145a194c8b Update README.md (#95)
Fixed a small typo
2018-10-03 13:37:17 +05:30
Vibhu Agarwal
ac379c9c03 Fixed input-output of 4th example explanation code (#92)
Ref. example: Deep down, we're all the same
2018-08-28 14:24:54 +05:30
cclauss
2fb04501f7 Fix Python 3 compatibility in the irrelevant code! (#86) 2018-06-22 01:17:51 +05:30
Satwik Kansal
07861a045d Fix an error in the irrelevant code!
Fixes https://github.com/satwikkansal/wtfpython/issues/85
2018-06-19 01:05:32 +05:30
Satwik Kansal
5484680721 Fix incorrect output in "Mysterious key type conversion" example
Fixes https://github.com/satwikkansal/wtfpython/issues/84
2018-06-15 00:48:50 +05:30
Satwik Kansal
d2507c2ff3
Simplify explanation 2018-05-30 00:29:56 +05:30
BOOK
2188fa30cd Update README.md (#82)
Improve explanation for "Strings can be tricky sometimes"
2018-05-30 00:22:49 +05:30
Satwik Kansal
3df9152ec9
Update README.md 2018-05-28 18:05:21 +05:30
Satwik Kansal
518881c70e Correct the snippet in Tic-tac-toe explanation
Fixes https://github.com/satwikkansal/wtfpython/issues/81
2018-05-23 18:16:25 +05:30
Harmon
169fa2fb5e Fix grammatical error (#75) 2018-03-07 02:24:36 +05:30
Mélanie Chauvel
db35390786 Fix a syntax error and some spelling errors (#72) 2018-03-01 02:07:48 +05:30
Satwik Kansal
ea5fc2f47f Update contents 2018-02-26 00:39:01 +05:30
Satwik Kansal
c13ce9701a Add sohaibfarooqi to the contributors 2018-02-26 00:37:49 +05:30
Satwik Kansal
0c9acdcc8e Update TOC 2018-02-26 00:36:22 +05:30
Satwik Kansal
9608b2fcfc Merge examples 2018-02-26 00:34:22 +05:30
Sohaib Farooqi
70fe61737b Generator with Slice assignment trick 2018-02-26 00:18:56 +05:30
Satwik Kansal
240e216c51 Update explanation: Tic tac toe
Fixes https://github.com/satwikkansal/wtfpython/issues/68
2018-02-26 00:03:37 +05:30
Satwik Kansal
a0100a8b48 Update explanation: Strings can be tricky sometimes
Related to https://github.com/satwikkansal/wtfpython/issues/67
2018-02-25 23:31:46 +05:30
Semen Zhydenko
17e49ee9db Fix typos 2018-01-31 01:08:22 +05:30
7664476e51 Fix typo 2018-01-29 22:37:52 +05:30
Tom Ritchford
a9e72e03f4 Fix code sample for "65539 local variables" example 2018-01-29 15:40:02 +05:30
Tom Swirly
54ed75f77d Format and grammar tweak
* Tweaked a line break so a section number was correctly formatted
* Tweaked grammar to be slightly more natural
2018-01-29 15:36:02 +05:30
Connor Devlin
12e517b0e3 Added a contributor's code of conduct. 2018-01-27 10:04:49 +05:30
Satwik Kansal
2fda1ef070 Fix missing statement
Fixes https://github.com/satwikkansal/wtfpython/issues/57
2018-01-26 11:22:50 +05:30
Satwik Kansal
fc262f2444 Fix broken TOC links 2018-01-26 11:22:50 +05:30
Srdjan Grubor
5d2e377487 Removed byte-compiled and cached files
These should never be commited to repos and they're also now on
gitignore.
2018-01-26 10:18:19 +05:30
Satwik Kansal
c28b292184 Update version 2018-01-25 18:59:07 +05:30
Satwik Kansal
98ef2dad4a Reorder the sections 2018-01-26 00:13:40 +05:30
Satwik Kansal
86462ed1e5
Update README.md 2018-01-25 21:13:04 +05:30
Satwik Kansal
9d713f0fa5
Fix formatting 2018-01-25 20:45:14 +05:30
Satwik Kansal
79d396a1fb Update description 2018-01-23 15:34:06 +05:30
Satwik Kansal
f7db9aace7 Relase 0.2.0 🎉 2018-01-23 14:44:45 +05:30
Satwik Kansal
054e88f7b2 Change case 2018-01-23 14:42:45 +05:30
Satwik Kansal
674fc891b4 Add figure related to string intern 2018-01-23 14:40:49 +05:30
Satwik Kansal
9ac6470efc Add logo image 2018-01-23 14:33:49 +05:30
Satwik Kansal
5061af0b6e Add new images 2018-01-23 14:32:02 +05:30
Satwik Kansal
980798fd36 Update guidelines 2018-01-23 14:31:44 +05:30
Satwik Kansal
b362cc9d0a Add new links 2018-01-23 14:31:31 +05:30
43 changed files with 20919 additions and 3494 deletions

21
.gitignore vendored
View File

@ -1,5 +1,20 @@
.DS_Store
node_modules node_modules
npm-debug.log npm-debug.log
wtfpython-pypi/build/
wtfpython-pypi/dist/ # Python-specific byte-compiled files should be ignored
wtfpython-pypi/wtfpython.egg-info __pycache__/
*.py[cod]
*$py.class
irrelevant/.ipynb_checkpoints/
irrelevant/.python-version
.idea/
.vscode/
# Virtual envitonments
venv/
.venv/

1
.npmignore vendored
View File

@ -1 +0,0 @@
irrelevant/

3
.travis.yml vendored Normal file
View File

@ -0,0 +1,3 @@
language: python
install: pip install flake8
script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

41
CONTRIBUTING.md vendored
View File

@ -1,10 +1,8 @@
All kinds of patches are welcome. Feel free to even suggest some catchy and funny titles for the existing Examples. The goal is to make this collection as interesting to read as possible. All kinds of patches are welcome. Feel free to even suggest some catchy and funny titles for the existing Examples. The goal is to make this collection as interesting to read as possible. Here are a few ways through which you can contribute,
If the changes you suggest are siginificant, filing an issue before submitting the actual patch will be appreciated. If you'd like to work on the issue (highly encouraged), you can mention that you're interested in working on it while creating the issue and get assigned to it. - If you are interested in translating the project to another language (some people have done that in the past), please feel free to open up an issue, and let me know if you need any kind of help.
- If the changes you suggest are significant, filing an issue before submitting the actual patch will be appreciated. If you'd like to work on the issue (highly encouraged), you can mention that you're interested in working on it while creating the issue and get assigned to it.
If you're adding a new example, please do create an issue to discuss it before submitting a patch. - If you're adding a new example, it is highly recommended to create an issue to discuss it before submitting a patch. You can use the following template for adding a new example:
You can use the following template for adding a new example:
<pre> <pre>
### ▶ Some fancy Title * ### ▶ Some fancy Title *
@ -27,10 +25,39 @@ Probably unexpected output
```py ```py
Setting up examples for clarification (if necessary) Setting up examples for clarification (if necessary)
``` ```
**Outupt:** **Output:**
```py ```py
>>> trigger # some example that makes it easy to unveil the magic >>> trigger # some example that makes it easy to unveil the magic
# some justified output # some justified output
``` ```
``` ```
</pre> </pre>
Few things that you can consider while writing an example,
- If you are choosing to submit a new example without creating an issue and discussing, please check the project to make sure there aren't similar examples already.
- Try to be consistent with the namings and the values you use with the variables. For instance, most variable names in the project are along the lines of `some_string`, `some_list`, `some_dict`, etc. You'd see a lot of `x`s for single letter variable names, and `"wtf"` as values for strings. There's no strictly enforced scheme in the project as such, but you can take a glance at other examples to get a gist.
- Try to be as creative as possible to add that element of "surprise" in the setting up part of an example. Sometimes this may mean writing a snippet a sane programmer would never write.
- Also, feel free to add your name to the [contributors list](/CONTRIBUTORS.md).
**Some FAQs**
What is is this after every snippet title (###) in the README: <!-- Example ID: 30f1d3fc-e267-4b30-84ef-4d9e7091ac1a --->? Should it be added manually or can it be ignored when creating new snippets?
That's a random UUID, it is used to keep identify the examples across multiple translations of the project. As a contributor, you don't have to worry about behind the scenes of how it is used, you just have to add a new random UUID to new examples in that format.
Where should new snippets be added? Top/bottom of the section, doesn't ?
There are multiple things that are considered to decide the order (the dependency on the other examples, difficulty level, category, etc). I'd suggest simply adding the new example at the bottom of a section you find more fitting (or just add it to the Miscellaneous section). Its order will be taken care of in future revisions.
What's the difference between the sections (the first two feel very similar)?
The section "Strain your brain" contains more contrived examples that you may not really encounter in real life, whereas the section "Slippery Slopes" contains examples that have the potential to be encountered more frequently while programming.
Before the table of contents it says that markdown-toc -i README.md --maxdepth 3 was used to create it. The pip package markdown-toc does not contain either -i or --maxdepth flags. Which package is meant, or what version of that package?
Should the new table of contents entry for the snippet be created with the above command or created manually (in case the above command does more than only add the entry)?
We use the [markdown-toc](https://www.npmjs.com/package/markdown-toc) npm package to generate ToC. It has some issues with special characters though (I'm not sure if it's fixed yet). More often than not, I just end up inserting the toc link manually at the right place. The tool is handy when I have to big reordering, otherwise just updating toc manually is more convenient imo.
If you have any questions feel free to ask on [this issue](https://github.com/satwikkansal/wtfpython/issues/269) (thanks to [@LiquidFun](https://github.com/LiquidFun) for starting it).

47
CONTRIBUTORS.md vendored
View File

@ -1,13 +1,42 @@
I'm really greatful to all the contributors. Following are the wonderful people (in no specific order) who have contributed their examples to wtfpython. Following are the wonderful people (in no specific order) who have contributed their examples to wtfpython.
| Contributor | Github | Issues | | Contributor | Github | Issues |
|-------------|--------|--------| |-------------|--------|--------|
| Lucas-C | [Lucas-C](https://github.com/Lucas-C) | [#36](https:/github.com/satwikkansal/wtfpython/issues/36) | | Lucas-C | [Lucas-C](https://github.com/Lucas-C) | [#36](https://github.com/satwikkansal/wtfpython/issues/36) |
| MittalAshok | [MittalAshok](https://github.com/MittalAshok) | [#23](https:/github.com/satwikkansal/wtfpython/issues/23) | | MittalAshok | [MittalAshok](https://github.com/MittalAshok) | [#23](https://github.com/satwikkansal/wtfpython/issues/23) |
| asottile | [asottile](https://github.com/asottile) | [#40](https:/github.com/satwikkansal/wtfpython/issues/40) | | asottile | [asottile](https://github.com/asottile) | [#40](https://github.com/satwikkansal/wtfpython/issues/40) |
| MostAwesomeDude | [MostAwesomeDude](https://github.com/MostAwesomeDude) | [#1](https:/github.com/satwikkansal/wtfpython/issues/1) | | MostAwesomeDude | [MostAwesomeDude](https://github.com/MostAwesomeDude) | [#1](https://github.com/satwikkansal/wtfpython/issues/1) |
| tukkek | [tukkek](https://github.com/tukkek) | [#11](https:/github.com/satwikkansal/wtfpython/issues/11), [#26](https:/github.com/satwikkansal/wtfpython/issues/26) | | tukkek | [tukkek](https://github.com/tukkek) | [#11](https://github.com/satwikkansal/wtfpython/issues/11), [#26](https://github.com/satwikkansal/wtfpython/issues/26) |
| PiaFraus | [PiaFraus](https://github.com/PiaFraus) | [#9](https:/github.com/satwikkansal/wtfpython/issues/9) | | PiaFraus | [PiaFraus](https://github.com/PiaFraus) | [#9](https://github.com/satwikkansal/wtfpython/issues/9) |
| chris-rands | [chris-rands](https://github.com/chris-rands) | [#32](https:/github.com/satwikkansal/wtfpython/issues/32) | | 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) |
| ipid | [ipid](https://github.com/ipid) | [#145](https://github.com/satwikkansal/wtfpython/issues/145) |
| roshnet | [roshnet](https://github.com/roshnet) | [#140](https://github.com/satwikkansal/wtfpython/issues/140) |
| daidai21 | [daidai21](https://github.com/daidai21) | [#137](https://github.com/satwikkansal/wtfpython/issues/137) |
| scidam | [scidam](https://github.com/scidam) | [#136](https://github.com/satwikkansal/wtfpython/issues/136) |
| pmjpawelec | [pmjpawelec](https://github.com/pmjpawelec) | [#121](https://github.com/satwikkansal/wtfpython/issues/121) |
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [#112](https://github.com/satwikkansal/wtfpython/issues/112) |
| mishaturnbull | [mishaturnbull](https://github.com/mishaturnbull) | [#108](https://github.com/satwikkansal/wtfpython/issues/108) |
| MuseBoy | [MuseBoy](https://github.com/MuseBoy) | [#101](https://github.com/satwikkansal/wtfpython/issues/101) |
| Ghost account | N/A | [#96](https://github.com/satwikkansal/wtfpython/issues/96) |
| koddo | [koddo](https://github.com/koddo) | [#80](https://github.com/satwikkansal/wtfpython/issues/80), [#73](https://github.com/satwikkansal/wtfpython/issues/73) |
| jab | [jab](https://github.com/jab) | [#77](https://github.com/satwikkansal/wtfpython/issues/77) |
| Jongy | [Jongy](https://github.com/Jongy) | [#208](https://github.com/satwikkansal/wtfpython/issues/208), [#210](https://github.com/satwikkansal/wtfpython/issues/210), [#233](https://github.com/satwikkansal/wtfpython/issues/233) |
| Diptangsu Goswami | [diptangsu](https://github.com/diptangsu) | [#193](https://github.com/satwikkansal/wtfpython/issues/193) |
| Charles | [charles-l](https://github.com/charles-l) | [#245](https://github.com/satwikkansal/wtfpython/issues/245) |
| LiquidFun | [LiquidFun](https://github.com/LiquidFun) | [#267](https://github.com/satwikkansal/wtfpython/issues/267) |
Thank you all for taking out time, and helping to make this project awesome! :smile: ---
**Translations**
| Translator | Github | Language |
|-------------|--------|--------|
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [Chinese](https://github.com/leisurelicht/wtfpython-cn) |
| vuduclyunitn | [vuduclyunitn](https://github.com/vuduclyunitn) | [Vietnamese](https://github.com/vuduclyunitn/wtfptyhon-vi) |
| José De Freitas | [JoseDeFreitas](https://github.com/JoseDeFreitas) | [Spanish](https://github.com/JoseDeFreitas/wtfpython-es) |
| Vadim Nifadev | [nifadyev](https://github.com/nifadyev) | [Russian](https://github.com/satwikkansal/wtfpython/tree/master/translations/ru-russian) |
Thank you all for your time and making wtfpython more awesome! :smile:
PS: This list is updated after every major release, if I forgot to add your contribution here, please feel free to raise a Pull request.

3670
README.md vendored

File diff suppressed because it is too large Load Diff

74
code-of-conduct.md vendored Normal file
View File

@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org

38
images/logo.svg vendored Executable file
View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="300px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
<g><path style="opacity:0.534" fill="#000000" d="M 93.5,49.5 C 106.479,48.4209 118.479,51.2543 129.5,58C 151.339,72.4912 157.172,91.9912 147,116.5C 137.557,132.756 123.391,141.423 104.5,142.5C 104.669,147.181 105.002,151.848 105.5,156.5C 109.607,156.925 113.274,158.425 116.5,161C 121.053,166.43 126.053,171.43 131.5,176C 138.937,179.109 146.604,181.442 154.5,183C 145.628,183.366 137.294,181.366 129.5,177C 124.5,172 119.5,167 114.5,162C 111.852,159.95 108.852,158.784 105.5,158.5C 105.714,175.884 104.881,193.217 103,210.5C 88.7522,229.986 75.7522,250.319 64,271.5C 63.1072,272.711 62.2739,272.711 61.5,271.5C 73.4183,249.987 86.585,229.32 101,209.5C 102.454,195.86 103.62,182.193 104.5,168.5C 103.868,164.183 103.368,159.85 103,155.5C 92.0497,160.785 81.8831,167.285 72.5,175C 67.7905,182.253 62.9572,189.42 58,196.5C 57.5,196 57,195.5 56.5,195C 61.2528,187.493 66.2528,180.16 71.5,173C 80.7973,165.048 91.1306,158.715 102.5,154C 103.803,150.532 103.803,147.032 102.5,143.5C 69.2933,139.465 53.7933,120.798 56,87.5C 60.0825,66.2519 72.5825,53.5853 93.5,49.5 Z M 87.5,53.5 C 82.3351,57.5863 76.6685,60.9196 70.5,63.5C 74.752,57.8701 80.4187,54.5368 87.5,53.5 Z M 92.5,54.5 C 135.035,52.8481 151.202,72.5148 141,113.5C 134.7,128.967 123.2,136.634 106.5,136.5C 64.7957,133.711 50.629,112.711 64,73.5C 65.4578,71.04 67.2911,68.8734 69.5,67C 77.2602,62.7905 84.9269,58.6238 92.5,54.5 Z M 92.5,64.5 C 106.636,61.5508 114.969,67.0508 117.5,81C 115.943,91.5504 109.776,96.7171 99,96.5C 97.8468,99.7111 97.1802,103.044 97,106.5C 94.6194,105.565 92.1194,105.232 89.5,105.5C 85.8309,91.9324 90.8309,85.4324 104.5,86C 108.876,72.8768 104.543,68.7101 91.5,73.5C 87.2971,69.7273 87.6304,66.7273 92.5,64.5 Z M 111.5,65.5 C 112.077,64.2267 112.743,64.2267 113.5,65.5C 113.03,66.463 112.363,66.463 111.5,65.5 Z M 114.5,68.5 C 115.497,67.2875 116.497,67.4542 117.5,69C 116.423,69.4696 115.423,69.3029 114.5,68.5 Z M 117.5,70.5 C 119.852,71.5426 120.019,72.8759 118,74.5C 116.666,73.1221 116.499,71.7887 117.5,70.5 Z M 119.5,75.5 C 120.773,76.0768 120.773,76.7435 119.5,77.5C 118.537,77.0302 118.537,76.3635 119.5,75.5 Z M 144.5,75.5 C 146.856,78.7145 148.356,82.3812 149,86.5C 150.768,98.9946 148.434,110.661 142,121.5C 139.91,124.428 137.41,126.761 134.5,128.5C 145.662,112.482 148.995,94.8151 144.5,75.5 Z M 118.5,79.5 C 120.337,79.6395 120.67,80.3061 119.5,81.5C 118.702,81.0431 118.369,80.3764 118.5,79.5 Z M 100.5,101.5 C 100.783,100.711 101.283,100.044 102,99.5C 102.528,100.816 102.028,101.483 100.5,101.5 Z M 101.5,104.5 C 100.923,105.773 100.257,105.773 99.5,104.5C 99.9698,103.537 100.637,103.537 101.5,104.5 Z M 96.5,112.5 C 101.732,113.702 102.898,116.702 100,121.5C 97.4406,124.349 94.2739,125.183 90.5,124C 87.2091,121.668 86.7091,118.835 89,115.5C 90,114.167 91,114.167 92,115.5C 93.4087,114.219 94.9087,113.219 96.5,112.5 Z M 73.5,130.5 C 87.7227,137.443 102.723,139.943 118.5,138C 105.586,141.789 92.9193,141.123 80.5,136C 77.7339,134.629 75.4006,132.796 73.5,130.5 Z"/></g>
<g><path style="opacity:0.547" fill="#000000" d="M 99.5,59.5 C 118.613,60.4501 125.446,70.1167 120,88.5C 116.128,93.0516 111.295,95.885 105.5,97C 104.851,100.195 104.018,103.361 103,106.5C 101.806,107.43 100.473,108.097 99,108.5C 95.2825,107.904 91.6158,107.238 88,106.5C 85.4312,99.218 86.2645,92.3846 90.5,86C 94.7594,84.958 99.0928,84.1246 103.5,83.5C 105.947,77.3939 103.947,73.7272 97.5,72.5C 94.9272,73.2525 92.7605,74.5859 91,76.5C 88.6764,73.8629 86.843,70.8629 85.5,67.5C 86.3128,66.1861 87.3128,65.0195 88.5,64C 92.2618,62.5834 95.9285,61.0834 99.5,59.5 Z M 92.5,64.5 C 87.6304,66.7273 87.2971,69.7273 91.5,73.5C 104.543,68.7101 108.876,72.8768 104.5,86C 90.8309,85.4324 85.8309,91.9324 89.5,105.5C 92.1194,105.232 94.6194,105.565 97,106.5C 97.1802,103.044 97.8468,99.7111 99,96.5C 109.776,96.7171 115.943,91.5504 117.5,81C 114.969,67.0508 106.636,61.5508 92.5,64.5 Z M 111.5,65.5 C 112.363,66.463 113.03,66.463 113.5,65.5C 112.743,64.2267 112.077,64.2267 111.5,65.5 Z M 114.5,68.5 C 115.423,69.3029 116.423,69.4696 117.5,69C 116.497,67.4542 115.497,67.2875 114.5,68.5 Z M 117.5,70.5 C 116.499,71.7887 116.666,73.1221 118,74.5C 120.019,72.8759 119.852,71.5426 117.5,70.5 Z M 119.5,75.5 C 118.537,76.3635 118.537,77.0302 119.5,77.5C 120.773,76.7435 120.773,76.0768 119.5,75.5 Z M 118.5,79.5 C 118.369,80.3764 118.702,81.0431 119.5,81.5C 120.67,80.3061 120.337,79.6395 118.5,79.5 Z M 100.5,101.5 C 102.028,101.483 102.528,100.816 102,99.5C 101.283,100.044 100.783,100.711 100.5,101.5 Z M 101.5,104.5 C 100.637,103.537 99.9698,103.537 99.5,104.5C 100.257,105.773 100.923,105.773 101.5,104.5 Z"/></g>
<g><path style="opacity:0.565" fill="#000000" d="M 201.5,84.5 C 230.503,85.6463 259.503,85.6463 288.5,84.5C 294.507,84.9098 300.507,85.4098 306.5,86C 306.887,100.522 307.554,115.189 308.5,130C 308.109,140.236 307.109,150.403 305.5,160.5C 321.506,157.534 335.006,161.867 346,173.5C 354.246,186.356 352.08,197.19 339.5,206C 331.632,208.547 324.799,212.714 319,218.5C 318,221.167 317,223.833 316,226.5C 313.343,227.573 311.177,229.24 309.5,231.5C 311.422,232.711 313.255,234.044 315,235.5C 315.667,237.167 315.667,238.833 315,240.5C 310.425,245.746 305.258,250.246 299.5,254C 294.97,254.947 290.636,254.447 286.5,252.5C 284.605,250.133 284.105,247.466 285,244.5C 289.21,235.31 296.376,231.143 306.5,232C 308.392,228.442 311.225,225.942 315,224.5C 315.389,219.102 317.889,214.935 322.5,212C 331.254,208.545 339.088,203.712 346,197.5C 351.72,185.315 348.886,175.482 337.5,168C 327.484,162.386 316.818,160.553 305.5,162.5C 306.834,169.656 304.5,175.156 298.5,179C 285.181,180.07 271.847,180.904 258.5,181.5C 242.793,180.438 227.127,178.938 211.5,177C 200.505,176.5 189.505,176.333 178.5,176.5C 177.393,148.181 177.227,119.848 178,91.5C 178.374,90.5838 178.874,89.7504 179.5,89C 186.877,87.0251 194.211,85.5251 201.5,84.5 Z M 199.5,86.5 C 212.855,86.4009 226.188,86.9009 239.5,88C 223.48,89.8508 207.48,89.8508 191.5,88C 194.365,87.8171 197.031,87.3171 199.5,86.5 Z M 276.5,86.5 C 285.884,86.1841 295.218,86.6841 304.5,88C 302.541,89.0963 300.375,89.5963 298,89.5C 288.51,88.8265 279.01,88.3265 269.5,88C 272.036,87.8138 274.369,87.3138 276.5,86.5 Z M 184.5,89.5 C 193.572,90.7076 202.738,91.3742 212,91.5C 241.518,88.8408 271.018,88.8408 300.5,91.5C 301.659,118.76 301.492,146.426 300,174.5C 299.5,175 299,175.5 298.5,176C 273.182,180.597 247.849,180.597 222.5,176C 208.516,175.001 194.516,174.501 180.5,174.5C 178.703,149.358 178.037,124.191 178.5,99C 178.762,96.4528 179.262,93.9528 180,91.5C 181.622,90.9011 183.122,90.2344 184.5,89.5 Z M 303.5,91.5 C 304.465,92.7211 304.298,94.0544 303,95.5C 302.421,94.0715 302.588,92.7382 303.5,91.5 Z M 240.5,100.5 C 251.838,100.333 263.172,100.5 274.5,101C 277.226,101.182 279.893,101.682 282.5,102.5C 282.754,120.447 283.421,138.447 284.5,156.5C 284.441,158.891 284.107,161.225 283.5,163.5C 273.451,163.351 263.284,163.684 253,164.5C 233.502,163.71 214.002,163.043 194.5,162.5C 193.29,143.18 192.29,123.847 191.5,104.5C 208.032,103.86 224.365,102.527 240.5,100.5 Z M 241.5,107.5 C 244.861,108.203 245.194,109.537 242.5,111.5C 241.571,110.311 241.238,108.978 241.5,107.5 Z M 304.5,111.5 C 305.097,111.735 305.43,112.235 305.5,113C 304.683,114.49 303.85,115.99 303,117.5C 302.591,115.305 303.091,113.305 304.5,111.5 Z M 305.5,116.5 C 306.598,117.601 306.765,118.934 306,120.5C 305,122.167 304,123.833 303,125.5C 303.206,122.394 304.039,119.394 305.5,116.5 Z M 305.5,129.5 C 306.27,132.383 305.437,135.05 303,137.5C 302.333,136.167 302.333,134.833 303,133.5C 304.095,132.307 304.928,130.973 305.5,129.5 Z M 252.5,142.5 C 253.5,142.5 254.5,142.5 255.5,142.5C 255.778,144.346 255.111,145.68 253.5,146.5C 252.571,145.311 252.238,143.978 252.5,142.5 Z M 304.5,147.5 C 305.629,149.666 305.129,151.666 303,153.5C 303.15,151.494 303.65,149.494 304.5,147.5 Z M 296.5,234.5 C 301.511,234.334 306.511,234.501 311.5,235C 313.211,236.133 313.711,237.633 313,239.5C 307.764,248.865 299.93,253.032 289.5,252C 286.797,250.18 285.964,247.68 287,244.5C 289.056,240.008 292.223,236.675 296.5,234.5 Z"/></g>
<g><path style="opacity:0.581" fill="#000000" d="M 258.5,98.5 C 267.212,98.7261 275.879,99.3928 284.5,100.5C 284.977,122.497 285.311,144.497 285.5,166.5C 254.603,165.98 223.77,164.98 193,163.5C 191.215,143.28 190.382,123.114 190.5,103C 213.274,100.85 235.941,99.3501 258.5,98.5 Z M 240.5,100.5 C 224.365,102.527 208.032,103.86 191.5,104.5C 192.29,123.847 193.29,143.18 194.5,162.5C 214.002,163.043 233.502,163.71 253,164.5C 263.284,163.684 273.451,163.351 283.5,163.5C 284.107,161.225 284.441,158.891 284.5,156.5C 283.421,138.447 282.754,120.447 282.5,102.5C 279.893,101.682 277.226,101.182 274.5,101C 263.172,100.5 251.838,100.333 240.5,100.5 Z M 241.5,107.5 C 241.238,108.978 241.571,110.311 242.5,111.5C 245.194,109.537 244.861,108.203 241.5,107.5 Z M 252.5,142.5 C 252.238,143.978 252.571,145.311 253.5,146.5C 255.111,145.68 255.778,144.346 255.5,142.5C 254.5,142.5 253.5,142.5 252.5,142.5 Z"/></g>
<g><path style="opacity:1" fill="#3771a2" d="M 245.5,103.5 C 249.619,103.488 253.452,104.488 257,106.5C 258.563,111.718 258.896,117.051 258,122.5C 257.5,124.333 256.333,125.5 254.5,126C 249.447,126.217 244.447,126.717 239.5,127.5C 238.808,128.025 238.308,128.692 238,129.5C 237.502,132.482 237.335,135.482 237.5,138.5C 234.635,138.945 232.135,138.278 230,136.5C 226.638,129.903 226.804,123.403 230.5,117C 236.419,115.804 242.419,115.138 248.5,115C 245.183,114.502 241.85,114.335 238.5,114.5C 238.336,111.813 238.503,109.146 239,106.5C 241.166,105.269 243.333,104.269 245.5,103.5 Z M 241.5,107.5 C 241.238,108.978 241.571,110.311 242.5,111.5C 245.194,109.537 244.861,108.203 241.5,107.5 Z"/></g>
<g><path style="opacity:0.355" fill="#000000" d="M 197.5,105.5 C 198.289,105.783 198.956,106.283 199.5,107C 195.364,110.545 194.697,110.045 197.5,105.5 Z"/></g>
<g><path style="opacity:0.461" fill="#000000" d="M 200.5,109.5 C 202.028,109.517 202.528,110.184 202,111.5C 200.333,112.833 198.667,114.167 197,115.5C 196.5,115 196,114.5 195.5,114C 197.24,112.483 198.906,110.983 200.5,109.5 Z"/></g>
<g><path style="opacity:0.559" fill="#000000" d="M 91.5,110.5 C 95.717,110.447 100.05,110.947 104.5,112C 108.277,119.115 106.277,123.782 98.5,126C 87.2522,127.947 83.7522,123.781 88,113.5C 89.1451,112.364 90.3117,111.364 91.5,110.5 Z M 96.5,112.5 C 94.9087,113.219 93.4087,114.219 92,115.5C 91,114.167 90,114.167 89,115.5C 86.7091,118.835 87.2091,121.668 90.5,124C 94.2739,125.183 97.4406,124.349 100,121.5C 102.898,116.702 101.732,113.702 96.5,112.5 Z"/></g>
<g><path style="opacity:0.994" fill="#fdd041" d="M 259.5,115.5 C 262.157,115.162 264.49,115.829 266.5,117.5C 272.893,134.625 266.893,141.792 248.5,139C 251.817,139.498 255.15,139.665 258.5,139.5C 259.411,146.925 256.078,150.592 248.5,150.5C 240.385,150.39 237.052,146.39 238.5,138.5C 238.667,135.833 238.833,133.167 239,130.5C 239.833,129.667 240.667,128.833 241.5,128C 246.5,127.667 251.5,127.333 256.5,127C 257.333,126.167 258.167,125.333 259,124.5C 259.498,121.518 259.665,118.518 259.5,115.5 Z M 252.5,142.5 C 252.238,143.978 252.571,145.311 253.5,146.5C 255.111,145.68 255.778,144.346 255.5,142.5C 254.5,142.5 253.5,142.5 252.5,142.5 Z"/></g>
<g><path style="opacity:0.53" fill="#000000" d="M 195.5,194.5 C 226.578,195.56 257.578,197.727 288.5,201C 290.329,201.273 291.829,202.107 293,203.5C 293.695,206.385 294.528,209.218 295.5,212C 291.492,219.977 285.825,226.644 278.5,232C 264.495,231.833 250.495,231.167 236.5,230C 219.234,227.676 201.9,226.01 184.5,225C 181.058,224.573 179.558,222.74 180,219.5C 184.203,210.486 189.37,202.153 195.5,194.5 Z M 196.5,196.5 C 227.585,197.464 258.585,199.63 289.5,203C 291.767,204.081 291.934,205.581 290,207.5C 286.167,211.333 282.333,215.167 278.5,219C 279,219.167 279.5,219.333 280,219.5C 283.934,215.566 287.934,211.566 292,207.5C 292.5,209 293,210.5 293.5,212C 289.644,218.865 284.644,224.865 278.5,230C 247.051,229.389 215.718,227.055 184.5,223C 183.09,222.632 182.09,221.799 181.5,220.5C 186.01,212.136 191.01,204.136 196.5,196.5 Z"/></g>
<g><path style="opacity:0.528" fill="#000000" d="M 202.5,200.5 C 207.244,200.038 208.244,201.538 205.5,205C 203.866,205.494 202.199,205.66 200.5,205.5C 200.365,203.446 201.032,201.779 202.5,200.5 Z"/></g>
<g><path style="opacity:0.501" fill="#000000" d="M 211.5,202.5 C 214.896,202.633 215.229,203.633 212.5,205.5C 213.5,206.167 214.5,206.833 215.5,207.5C 213.136,208.82 211.469,208.154 210.5,205.5C 210.685,204.416 211.018,203.416 211.5,202.5 Z"/></g>
<g><path style="opacity:0.38" fill="#000000" d="M 240.5,204.5 C 242.308,204.491 243.975,204.991 245.5,206C 245,206.5 244.5,207 244,207.5C 242.271,207.026 241.105,206.026 240.5,204.5 Z"/></g>
<g><path style="opacity:0.511" fill="#000000" d="M 253.5,205.5 C 255.264,204.288 256.93,204.621 258.5,206.5C 256.603,207.652 254.936,207.319 253.5,205.5 Z"/></g>
<g><path style="opacity:0.47" fill="#000000" d="M 271.5,205.5 C 274.462,205.117 275.462,206.117 274.5,208.5C 272.787,208.121 271.787,207.121 271.5,205.5 Z"/></g>
<g><path style="opacity:0.519" fill="#000000" d="M 249.5,207.5 C 250.675,207.281 251.675,207.614 252.5,208.5C 250.948,209.798 249.948,209.465 249.5,207.5 Z"/></g>
<g><path style="opacity:0.612" fill="#000000" d="M 279.5,207.5 C 281.167,207.5 282.833,207.5 284.5,207.5C 284.5,208.5 284.5,209.5 284.5,210.5C 282.396,210.799 280.396,210.466 278.5,209.5C 278.863,208.817 279.196,208.15 279.5,207.5 Z"/></g>
<g><path style="opacity:0.561" fill="#000000" d="M 199.5,209.5 C 202.68,209.176 203.847,210.51 203,213.5C 201.301,214.406 199.467,214.739 197.5,214.5C 197.392,212.486 198.058,210.82 199.5,209.5 Z"/></g>
<g><path style="opacity:0.414" fill="#000000" d="M 266.5,209.5 C 267.675,209.281 268.675,209.614 269.5,210.5C 267.948,211.798 266.948,211.465 266.5,209.5 Z"/></g>
<g><path style="opacity:0.57" fill="#000000" d="M 207.5,210.5 C 208.833,210.5 210.167,210.5 211.5,210.5C 211.143,214.395 209.143,215.395 205.5,213.5C 206.193,212.482 206.859,211.482 207.5,210.5 Z"/></g>
<g><path style="opacity:0.482" fill="#000000" d="M 236.5,211.5 C 241.645,212.482 241.812,214.149 237,216.5C 235.941,216.37 235.108,215.87 234.5,215C 235.823,214.184 236.489,213.017 236.5,211.5 Z"/></g>
<g><path style="opacity:0.513" fill="#000000" d="M 108.5,212.5 C 120.3,230.076 130.633,248.743 139.5,268.5C 139.167,268.833 138.833,269.167 138.5,269.5C 128.246,250.659 118.246,231.659 108.5,212.5 Z"/></g>
<g><path style="opacity:0.39" fill="#000000" d="M 219.5,212.5 C 221.549,212.706 221.883,213.539 220.5,215C 219.056,215.781 217.723,215.614 216.5,214.5C 217.602,213.824 218.602,213.158 219.5,212.5 Z"/></g>
<g><path style="opacity:0.435" fill="#000000" d="M 224.5,212.5 C 226.337,212.639 226.67,213.306 225.5,214.5C 224.702,214.043 224.369,213.376 224.5,212.5 Z"/></g>
<g><path style="opacity:0.602" fill="#000000" d="M 193.5,216.5 C 194.833,216.5 196.167,216.5 197.5,216.5C 197.5,217.833 197.5,219.167 197.5,220.5C 195.396,220.799 193.396,220.466 191.5,219.5C 192.193,218.482 192.859,217.482 193.5,216.5 Z"/></g>
<g><path style="opacity:0.453" fill="#000000" d="M 271.5,216.5 C 276.368,217.09 276.034,218.09 270.5,219.5C 269.833,219.167 269.167,218.833 268.5,218.5C 269.602,217.824 270.602,217.158 271.5,216.5 Z"/></g>
<g><path style="opacity:0.505" fill="#000000" d="M 213.5,218.5 C 216.022,218.128 218.022,218.961 219.5,221C 219.167,221.333 218.833,221.667 218.5,222C 214.129,222.828 209.795,222.661 205.5,221.5C 207.766,220.686 210.1,220.186 212.5,220C 213.056,219.617 213.389,219.117 213.5,218.5 Z"/></g>
<g><path style="opacity:0.373" fill="#000000" d="M 223.5,220.5 C 224.978,220.238 226.311,220.571 227.5,221.5C 226.833,221.833 226.167,222.167 225.5,222.5C 224.287,222.253 223.62,221.586 223.5,220.5 Z"/></g>
<g><path style="opacity:0.606" fill="#000000" d="M 255.5,220.5 C 257.288,220.215 258.955,220.548 260.5,221.5C 258.796,223.849 256.463,224.849 253.5,224.5C 253.527,222.801 254.194,221.467 255.5,220.5 Z"/></g>
<g><path style="opacity:0.498" fill="#000000" d="M 244.5,221.5 C 245.675,221.281 246.675,221.614 247.5,222.5C 244.272,225.259 243.272,224.926 244.5,221.5 Z"/></g>
<g><path style="opacity:0.373" fill="#000000" d="M 233.5,222.5 C 234.675,222.281 235.675,222.614 236.5,223.5C 234.948,224.798 233.948,224.465 233.5,222.5 Z"/></g>
<g><path style="opacity:0.512" fill="#000000" d="M 269.5,222.5 C 271.337,222.639 271.67,223.306 270.5,224.5C 265.586,225.869 265.253,225.203 269.5,222.5 Z"/></g>
<g><path style="opacity:0.652" fill="#000000" d="M 296.5,236.5 C 297.978,236.238 299.311,236.571 300.5,237.5C 299.68,239.111 298.346,239.778 296.5,239.5C 296.5,238.5 296.5,237.5 296.5,236.5 Z"/></g>
<g><path style="opacity:0.476" fill="#000000" d="M 309.5,236.5 C 310.289,236.783 310.956,237.283 311.5,238C 306.628,240.039 303.294,243.539 301.5,248.5C 300.686,246.048 301.186,243.715 303,241.5C 305.326,239.934 307.492,238.268 309.5,236.5 Z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 17 KiB

38
images/logo_dark_theme.svg vendored Executable file
View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="300px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
<g><path style="opacity:0.534" fill="#fefffe" d="M 93.5,49.5 C 106.479,48.4209 118.479,51.2543 129.5,58C 151.339,72.4912 157.172,91.9912 147,116.5C 137.557,132.756 123.391,141.423 104.5,142.5C 104.669,147.181 105.002,151.848 105.5,156.5C 109.607,156.925 113.274,158.425 116.5,161C 121.053,166.43 126.053,171.43 131.5,176C 138.937,179.109 146.604,181.442 154.5,183C 145.628,183.366 137.294,181.366 129.5,177C 124.5,172 119.5,167 114.5,162C 111.852,159.95 108.852,158.784 105.5,158.5C 105.714,175.884 104.881,193.217 103,210.5C 88.7522,229.986 75.7522,250.319 64,271.5C 63.1072,272.711 62.2739,272.711 61.5,271.5C 73.4183,249.987 86.585,229.32 101,209.5C 102.454,195.86 103.62,182.193 104.5,168.5C 103.868,164.183 103.368,159.85 103,155.5C 92.0497,160.785 81.8831,167.285 72.5,175C 67.7905,182.253 62.9572,189.42 58,196.5C 57.5,196 57,195.5 56.5,195C 61.2528,187.493 66.2528,180.16 71.5,173C 80.7973,165.048 91.1306,158.715 102.5,154C 103.803,150.532 103.803,147.032 102.5,143.5C 69.2933,139.465 53.7933,120.798 56,87.5C 60.0825,66.2519 72.5825,53.5853 93.5,49.5 Z M 87.5,53.5 C 82.3351,57.5863 76.6685,60.9196 70.5,63.5C 74.752,57.8701 80.4187,54.5368 87.5,53.5 Z M 92.5,54.5 C 135.035,52.8481 151.202,72.5148 141,113.5C 134.7,128.967 123.2,136.634 106.5,136.5C 64.7957,133.711 50.629,112.711 64,73.5C 65.4578,71.04 67.2911,68.8734 69.5,67C 77.2602,62.7905 84.9269,58.6238 92.5,54.5 Z M 92.5,64.5 C 106.636,61.5508 114.969,67.0508 117.5,81C 115.943,91.5504 109.776,96.7171 99,96.5C 97.8468,99.7111 97.1802,103.044 97,106.5C 94.6194,105.565 92.1194,105.232 89.5,105.5C 85.8309,91.9324 90.8309,85.4324 104.5,86C 108.876,72.8768 104.543,68.7101 91.5,73.5C 87.2971,69.7273 87.6304,66.7273 92.5,64.5 Z M 111.5,65.5 C 112.077,64.2267 112.743,64.2267 113.5,65.5C 113.03,66.463 112.363,66.463 111.5,65.5 Z M 114.5,68.5 C 115.497,67.2875 116.497,67.4542 117.5,69C 116.423,69.4696 115.423,69.3029 114.5,68.5 Z M 117.5,70.5 C 119.852,71.5426 120.019,72.8759 118,74.5C 116.666,73.1221 116.499,71.7887 117.5,70.5 Z M 119.5,75.5 C 120.773,76.0768 120.773,76.7435 119.5,77.5C 118.537,77.0302 118.537,76.3635 119.5,75.5 Z M 144.5,75.5 C 146.856,78.7145 148.356,82.3812 149,86.5C 150.768,98.9946 148.434,110.661 142,121.5C 139.91,124.428 137.41,126.761 134.5,128.5C 145.662,112.482 148.995,94.8151 144.5,75.5 Z M 118.5,79.5 C 120.337,79.6395 120.67,80.3061 119.5,81.5C 118.702,81.0431 118.369,80.3764 118.5,79.5 Z M 100.5,101.5 C 100.783,100.711 101.283,100.044 102,99.5C 102.528,100.816 102.028,101.483 100.5,101.5 Z M 101.5,104.5 C 100.923,105.773 100.257,105.773 99.5,104.5C 99.9698,103.537 100.637,103.537 101.5,104.5 Z M 96.5,112.5 C 101.732,113.702 102.898,116.702 100,121.5C 97.4406,124.349 94.2739,125.183 90.5,124C 87.2091,121.668 86.7091,118.835 89,115.5C 90,114.167 91,114.167 92,115.5C 93.4087,114.219 94.9087,113.219 96.5,112.5 Z M 73.5,130.5 C 87.7227,137.443 102.723,139.943 118.5,138C 105.586,141.789 92.9193,141.123 80.5,136C 77.7339,134.629 75.4006,132.796 73.5,130.5 Z"/></g>
<g><path style="opacity:0.547" fill="#fefffe" d="M 99.5,59.5 C 118.613,60.4501 125.446,70.1167 120,88.5C 116.128,93.0516 111.295,95.885 105.5,97C 104.851,100.195 104.018,103.361 103,106.5C 101.806,107.43 100.473,108.097 99,108.5C 95.2825,107.904 91.6158,107.238 88,106.5C 85.4312,99.218 86.2645,92.3846 90.5,86C 94.7594,84.958 99.0928,84.1246 103.5,83.5C 105.947,77.3939 103.947,73.7272 97.5,72.5C 94.9272,73.2525 92.7605,74.5859 91,76.5C 88.6764,73.8629 86.843,70.8629 85.5,67.5C 86.3128,66.1861 87.3128,65.0195 88.5,64C 92.2618,62.5834 95.9285,61.0834 99.5,59.5 Z M 92.5,64.5 C 87.6304,66.7273 87.2971,69.7273 91.5,73.5C 104.543,68.7101 108.876,72.8768 104.5,86C 90.8309,85.4324 85.8309,91.9324 89.5,105.5C 92.1194,105.232 94.6194,105.565 97,106.5C 97.1802,103.044 97.8468,99.7111 99,96.5C 109.776,96.7171 115.943,91.5504 117.5,81C 114.969,67.0508 106.636,61.5508 92.5,64.5 Z M 111.5,65.5 C 112.363,66.463 113.03,66.463 113.5,65.5C 112.743,64.2267 112.077,64.2267 111.5,65.5 Z M 114.5,68.5 C 115.423,69.3029 116.423,69.4696 117.5,69C 116.497,67.4542 115.497,67.2875 114.5,68.5 Z M 117.5,70.5 C 116.499,71.7887 116.666,73.1221 118,74.5C 120.019,72.8759 119.852,71.5426 117.5,70.5 Z M 119.5,75.5 C 118.537,76.3635 118.537,77.0302 119.5,77.5C 120.773,76.7435 120.773,76.0768 119.5,75.5 Z M 118.5,79.5 C 118.369,80.3764 118.702,81.0431 119.5,81.5C 120.67,80.3061 120.337,79.6395 118.5,79.5 Z M 100.5,101.5 C 102.028,101.483 102.528,100.816 102,99.5C 101.283,100.044 100.783,100.711 100.5,101.5 Z M 101.5,104.5 C 100.637,103.537 99.9698,103.537 99.5,104.5C 100.257,105.773 100.923,105.773 101.5,104.5 Z"/></g>
<g><path style="opacity:0.565" fill="#fefffe" d="M 201.5,84.5 C 230.503,85.6463 259.503,85.6463 288.5,84.5C 294.507,84.9098 300.507,85.4098 306.5,86C 306.887,100.522 307.554,115.189 308.5,130C 308.109,140.236 307.109,150.403 305.5,160.5C 321.506,157.534 335.006,161.867 346,173.5C 354.246,186.356 352.08,197.19 339.5,206C 331.632,208.547 324.799,212.714 319,218.5C 318,221.167 317,223.833 316,226.5C 313.343,227.573 311.177,229.24 309.5,231.5C 311.422,232.711 313.255,234.044 315,235.5C 315.667,237.167 315.667,238.833 315,240.5C 310.425,245.746 305.258,250.246 299.5,254C 294.97,254.947 290.636,254.447 286.5,252.5C 284.605,250.133 284.105,247.466 285,244.5C 289.21,235.31 296.376,231.143 306.5,232C 308.392,228.442 311.225,225.942 315,224.5C 315.389,219.102 317.889,214.935 322.5,212C 331.254,208.545 339.088,203.712 346,197.5C 351.72,185.315 348.886,175.482 337.5,168C 327.484,162.386 316.818,160.553 305.5,162.5C 306.834,169.656 304.5,175.156 298.5,179C 285.181,180.07 271.847,180.904 258.5,181.5C 242.793,180.438 227.127,178.938 211.5,177C 200.505,176.5 189.505,176.333 178.5,176.5C 177.393,148.181 177.227,119.848 178,91.5C 178.374,90.5838 178.874,89.7504 179.5,89C 186.877,87.0251 194.211,85.5251 201.5,84.5 Z M 199.5,86.5 C 212.855,86.4009 226.188,86.9009 239.5,88C 223.48,89.8508 207.48,89.8508 191.5,88C 194.365,87.8171 197.031,87.3171 199.5,86.5 Z M 276.5,86.5 C 285.884,86.1841 295.218,86.6841 304.5,88C 302.541,89.0963 300.375,89.5963 298,89.5C 288.51,88.8265 279.01,88.3265 269.5,88C 272.036,87.8138 274.369,87.3138 276.5,86.5 Z M 184.5,89.5 C 193.572,90.7076 202.738,91.3742 212,91.5C 241.518,88.8408 271.018,88.8408 300.5,91.5C 301.659,118.76 301.492,146.426 300,174.5C 299.5,175 299,175.5 298.5,176C 273.182,180.597 247.849,180.597 222.5,176C 208.516,175.001 194.516,174.501 180.5,174.5C 178.703,149.358 178.037,124.191 178.5,99C 178.762,96.4528 179.262,93.9528 180,91.5C 181.622,90.9011 183.122,90.2344 184.5,89.5 Z M 303.5,91.5 C 304.465,92.7211 304.298,94.0544 303,95.5C 302.421,94.0715 302.588,92.7382 303.5,91.5 Z M 240.5,100.5 C 251.838,100.333 263.172,100.5 274.5,101C 277.226,101.182 279.893,101.682 282.5,102.5C 282.754,120.447 283.421,138.447 284.5,156.5C 284.441,158.891 284.107,161.225 283.5,163.5C 273.451,163.351 263.284,163.684 253,164.5C 233.502,163.71 214.002,163.043 194.5,162.5C 193.29,143.18 192.29,123.847 191.5,104.5C 208.032,103.86 224.365,102.527 240.5,100.5 Z M 241.5,107.5 C 244.861,108.203 245.194,109.537 242.5,111.5C 241.571,110.311 241.238,108.978 241.5,107.5 Z M 304.5,111.5 C 305.097,111.735 305.43,112.235 305.5,113C 304.683,114.49 303.85,115.99 303,117.5C 302.591,115.305 303.091,113.305 304.5,111.5 Z M 305.5,116.5 C 306.598,117.601 306.765,118.934 306,120.5C 305,122.167 304,123.833 303,125.5C 303.206,122.394 304.039,119.394 305.5,116.5 Z M 305.5,129.5 C 306.27,132.383 305.437,135.05 303,137.5C 302.333,136.167 302.333,134.833 303,133.5C 304.095,132.307 304.928,130.973 305.5,129.5 Z M 252.5,142.5 C 253.5,142.5 254.5,142.5 255.5,142.5C 255.778,144.346 255.111,145.68 253.5,146.5C 252.571,145.311 252.238,143.978 252.5,142.5 Z M 304.5,147.5 C 305.629,149.666 305.129,151.666 303,153.5C 303.15,151.494 303.65,149.494 304.5,147.5 Z M 296.5,234.5 C 301.511,234.334 306.511,234.501 311.5,235C 313.211,236.133 313.711,237.633 313,239.5C 307.764,248.865 299.93,253.032 289.5,252C 286.797,250.18 285.964,247.68 287,244.5C 289.056,240.008 292.223,236.675 296.5,234.5 Z"/></g>
<g><path style="opacity:0.581" fill="#fefffe" d="M 258.5,98.5 C 267.212,98.7261 275.879,99.3928 284.5,100.5C 284.977,122.497 285.311,144.497 285.5,166.5C 254.603,165.98 223.77,164.98 193,163.5C 191.215,143.28 190.382,123.114 190.5,103C 213.274,100.85 235.941,99.3501 258.5,98.5 Z M 240.5,100.5 C 224.365,102.527 208.032,103.86 191.5,104.5C 192.29,123.847 193.29,143.18 194.5,162.5C 214.002,163.043 233.502,163.71 253,164.5C 263.284,163.684 273.451,163.351 283.5,163.5C 284.107,161.225 284.441,158.891 284.5,156.5C 283.421,138.447 282.754,120.447 282.5,102.5C 279.893,101.682 277.226,101.182 274.5,101C 263.172,100.5 251.838,100.333 240.5,100.5 Z M 241.5,107.5 C 241.238,108.978 241.571,110.311 242.5,111.5C 245.194,109.537 244.861,108.203 241.5,107.5 Z M 252.5,142.5 C 252.238,143.978 252.571,145.311 253.5,146.5C 255.111,145.68 255.778,144.346 255.5,142.5C 254.5,142.5 253.5,142.5 252.5,142.5 Z"/></g>
<g><path style="opacity:1" fill="#3771a2" d="M 245.5,103.5 C 249.619,103.488 253.452,104.488 257,106.5C 258.563,111.718 258.896,117.051 258,122.5C 257.5,124.333 256.333,125.5 254.5,126C 249.447,126.217 244.447,126.717 239.5,127.5C 238.808,128.025 238.308,128.692 238,129.5C 237.502,132.482 237.335,135.482 237.5,138.5C 234.635,138.945 232.135,138.278 230,136.5C 226.638,129.903 226.804,123.403 230.5,117C 236.419,115.804 242.419,115.138 248.5,115C 245.183,114.502 241.85,114.335 238.5,114.5C 238.336,111.813 238.503,109.146 239,106.5C 241.166,105.269 243.333,104.269 245.5,103.5 Z M 241.5,107.5 C 241.238,108.978 241.571,110.311 242.5,111.5C 245.194,109.537 244.861,108.203 241.5,107.5 Z"/></g>
<g><path style="opacity:0.355" fill="#fefffe" d="M 197.5,105.5 C 198.289,105.783 198.956,106.283 199.5,107C 195.364,110.545 194.697,110.045 197.5,105.5 Z"/></g>
<g><path style="opacity:0.461" fill="#fefffe" d="M 200.5,109.5 C 202.028,109.517 202.528,110.184 202,111.5C 200.333,112.833 198.667,114.167 197,115.5C 196.5,115 196,114.5 195.5,114C 197.24,112.483 198.906,110.983 200.5,109.5 Z"/></g>
<g><path style="opacity:0.559" fill="#fefffe" d="M 91.5,110.5 C 95.717,110.447 100.05,110.947 104.5,112C 108.277,119.115 106.277,123.782 98.5,126C 87.2522,127.947 83.7522,123.781 88,113.5C 89.1451,112.364 90.3117,111.364 91.5,110.5 Z M 96.5,112.5 C 94.9087,113.219 93.4087,114.219 92,115.5C 91,114.167 90,114.167 89,115.5C 86.7091,118.835 87.2091,121.668 90.5,124C 94.2739,125.183 97.4406,124.349 100,121.5C 102.898,116.702 101.732,113.702 96.5,112.5 Z"/></g>
<g><path style="opacity:0.994" fill="#fdd041" d="M 259.5,115.5 C 262.157,115.162 264.49,115.829 266.5,117.5C 272.893,134.625 266.893,141.792 248.5,139C 251.817,139.498 255.15,139.665 258.5,139.5C 259.411,146.925 256.078,150.592 248.5,150.5C 240.385,150.39 237.052,146.39 238.5,138.5C 238.667,135.833 238.833,133.167 239,130.5C 239.833,129.667 240.667,128.833 241.5,128C 246.5,127.667 251.5,127.333 256.5,127C 257.333,126.167 258.167,125.333 259,124.5C 259.498,121.518 259.665,118.518 259.5,115.5 Z M 252.5,142.5 C 252.238,143.978 252.571,145.311 253.5,146.5C 255.111,145.68 255.778,144.346 255.5,142.5C 254.5,142.5 253.5,142.5 252.5,142.5 Z"/></g>
<g><path style="opacity:0.53" fill="#fefffe" d="M 195.5,194.5 C 226.578,195.56 257.578,197.727 288.5,201C 290.329,201.273 291.829,202.107 293,203.5C 293.695,206.385 294.528,209.218 295.5,212C 291.492,219.977 285.825,226.644 278.5,232C 264.495,231.833 250.495,231.167 236.5,230C 219.234,227.676 201.9,226.01 184.5,225C 181.058,224.573 179.558,222.74 180,219.5C 184.203,210.486 189.37,202.153 195.5,194.5 Z M 196.5,196.5 C 227.585,197.464 258.585,199.63 289.5,203C 291.767,204.081 291.934,205.581 290,207.5C 286.167,211.333 282.333,215.167 278.5,219C 279,219.167 279.5,219.333 280,219.5C 283.934,215.566 287.934,211.566 292,207.5C 292.5,209 293,210.5 293.5,212C 289.644,218.865 284.644,224.865 278.5,230C 247.051,229.389 215.718,227.055 184.5,223C 183.09,222.632 182.09,221.799 181.5,220.5C 186.01,212.136 191.01,204.136 196.5,196.5 Z"/></g>
<g><path style="opacity:0.528" fill="#fefffe" d="M 202.5,200.5 C 207.244,200.038 208.244,201.538 205.5,205C 203.866,205.494 202.199,205.66 200.5,205.5C 200.365,203.446 201.032,201.779 202.5,200.5 Z"/></g>
<g><path style="opacity:0.501" fill="#fefffe" d="M 211.5,202.5 C 214.896,202.633 215.229,203.633 212.5,205.5C 213.5,206.167 214.5,206.833 215.5,207.5C 213.136,208.82 211.469,208.154 210.5,205.5C 210.685,204.416 211.018,203.416 211.5,202.5 Z"/></g>
<g><path style="opacity:0.38" fill="#fefffe" d="M 240.5,204.5 C 242.308,204.491 243.975,204.991 245.5,206C 245,206.5 244.5,207 244,207.5C 242.271,207.026 241.105,206.026 240.5,204.5 Z"/></g>
<g><path style="opacity:0.511" fill="#fefffe" d="M 253.5,205.5 C 255.264,204.288 256.93,204.621 258.5,206.5C 256.603,207.652 254.936,207.319 253.5,205.5 Z"/></g>
<g><path style="opacity:0.47" fill="#fefffe" d="M 271.5,205.5 C 274.462,205.117 275.462,206.117 274.5,208.5C 272.787,208.121 271.787,207.121 271.5,205.5 Z"/></g>
<g><path style="opacity:0.519" fill="#fefffe" d="M 249.5,207.5 C 250.675,207.281 251.675,207.614 252.5,208.5C 250.948,209.798 249.948,209.465 249.5,207.5 Z"/></g>
<g><path style="opacity:0.612" fill="#fefffe" d="M 279.5,207.5 C 281.167,207.5 282.833,207.5 284.5,207.5C 284.5,208.5 284.5,209.5 284.5,210.5C 282.396,210.799 280.396,210.466 278.5,209.5C 278.863,208.817 279.196,208.15 279.5,207.5 Z"/></g>
<g><path style="opacity:0.561" fill="#fefffe" d="M 199.5,209.5 C 202.68,209.176 203.847,210.51 203,213.5C 201.301,214.406 199.467,214.739 197.5,214.5C 197.392,212.486 198.058,210.82 199.5,209.5 Z"/></g>
<g><path style="opacity:0.414" fill="#fefffe" d="M 266.5,209.5 C 267.675,209.281 268.675,209.614 269.5,210.5C 267.948,211.798 266.948,211.465 266.5,209.5 Z"/></g>
<g><path style="opacity:0.57" fill="#fefffe" d="M 207.5,210.5 C 208.833,210.5 210.167,210.5 211.5,210.5C 211.143,214.395 209.143,215.395 205.5,213.5C 206.193,212.482 206.859,211.482 207.5,210.5 Z"/></g>
<g><path style="opacity:0.482" fill="#fefffe" d="M 236.5,211.5 C 241.645,212.482 241.812,214.149 237,216.5C 235.941,216.37 235.108,215.87 234.5,215C 235.823,214.184 236.489,213.017 236.5,211.5 Z"/></g>
<g><path style="opacity:0.513" fill="#fefffe" d="M 108.5,212.5 C 120.3,230.076 130.633,248.743 139.5,268.5C 139.167,268.833 138.833,269.167 138.5,269.5C 128.246,250.659 118.246,231.659 108.5,212.5 Z"/></g>
<g><path style="opacity:0.39" fill="#fefffe" d="M 219.5,212.5 C 221.549,212.706 221.883,213.539 220.5,215C 219.056,215.781 217.723,215.614 216.5,214.5C 217.602,213.824 218.602,213.158 219.5,212.5 Z"/></g>
<g><path style="opacity:0.435" fill="#fefffe" d="M 224.5,212.5 C 226.337,212.639 226.67,213.306 225.5,214.5C 224.702,214.043 224.369,213.376 224.5,212.5 Z"/></g>
<g><path style="opacity:0.602" fill="#fefffe" d="M 193.5,216.5 C 194.833,216.5 196.167,216.5 197.5,216.5C 197.5,217.833 197.5,219.167 197.5,220.5C 195.396,220.799 193.396,220.466 191.5,219.5C 192.193,218.482 192.859,217.482 193.5,216.5 Z"/></g>
<g><path style="opacity:0.453" fill="#fefffe" d="M 271.5,216.5 C 276.368,217.09 276.034,218.09 270.5,219.5C 269.833,219.167 269.167,218.833 268.5,218.5C 269.602,217.824 270.602,217.158 271.5,216.5 Z"/></g>
<g><path style="opacity:0.505" fill="#fefffe" d="M 213.5,218.5 C 216.022,218.128 218.022,218.961 219.5,221C 219.167,221.333 218.833,221.667 218.5,222C 214.129,222.828 209.795,222.661 205.5,221.5C 207.766,220.686 210.1,220.186 212.5,220C 213.056,219.617 213.389,219.117 213.5,218.5 Z"/></g>
<g><path style="opacity:0.373" fill="#fefffe" d="M 223.5,220.5 C 224.978,220.238 226.311,220.571 227.5,221.5C 226.833,221.833 226.167,222.167 225.5,222.5C 224.287,222.253 223.62,221.586 223.5,220.5 Z"/></g>
<g><path style="opacity:0.606" fill="#fefffe" d="M 255.5,220.5 C 257.288,220.215 258.955,220.548 260.5,221.5C 258.796,223.849 256.463,224.849 253.5,224.5C 253.527,222.801 254.194,221.467 255.5,220.5 Z"/></g>
<g><path style="opacity:0.498" fill="#fefffe" d="M 244.5,221.5 C 245.675,221.281 246.675,221.614 247.5,222.5C 244.272,225.259 243.272,224.926 244.5,221.5 Z"/></g>
<g><path style="opacity:0.373" fill="#fefffe" d="M 233.5,222.5 C 234.675,222.281 235.675,222.614 236.5,223.5C 234.948,224.798 233.948,224.465 233.5,222.5 Z"/></g>
<g><path style="opacity:0.512" fill="#fefffe" d="M 269.5,222.5 C 271.337,222.639 271.67,223.306 270.5,224.5C 265.586,225.869 265.253,225.203 269.5,222.5 Z"/></g>
<g><path style="opacity:0.652" fill="#fefffe" d="M 296.5,236.5 C 297.978,236.238 299.311,236.571 300.5,237.5C 299.68,239.111 298.346,239.778 296.5,239.5C 296.5,238.5 296.5,237.5 296.5,236.5 Z"/></g>
<g><path style="opacity:0.476" fill="#fefffe" d="M 309.5,236.5 C 310.289,236.783 310.956,237.283 311.5,238C 306.628,240.039 303.294,243.539 301.5,248.5C 300.686,246.048 301.186,243.715 303,241.5C 305.326,239.934 307.492,238.268 309.5,236.5 Z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 17 KiB

4
images/string-intern/string_interning.svg vendored Executable file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 27 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

View File

24
irrelevant/insert_ids.py Normal file
View File

@ -0,0 +1,24 @@
import uuid
new_file = []
original_file = []
fname = "../README.md"
def generate_random_id_comment():
random_id = uuid.uuid4()
return f"<!-- Example ID: {random_id} --!>"
with open(fname, "r") as f:
original_file = f.readlines()
for line in original_file:
new_file.append(line)
if line.strip().startswith("### "):
new_file.append(generate_random_id_comment())
with open(fname, "w") as f:
f.write("".join(new_file))

View File

@ -0,0 +1,397 @@
"""
An inefficient monolithic piece of code that'll generate jupyter notebook
from the projects main README.
PS: If you are a recruiter, please don't judge me by this piece of code. I wrote it
in hurry. I know this is messy and can be simplified, but I don't want to change it
much because it just works.
Simplifictions and improvements through patches are more than welcome however :)
#TODOs
- CLI arguments for running this thing
- Add it to prepush hook
- Add support for skip comments, to skip examples that are not meant for notebook environment.
- Use templates?
"""
import json
import os
import pprint
fpath = os.path.join(os.path.dirname( __file__ ), '..', 'README.md')
examples = []
# The globals
current_example = 1
sequence_num = 1
current_section_name = ""
STATEMENT_PREFIXES = ["...", ">>> ", "$ "]
HOSTED_NOTEBOOK_INSTRUCTIONS = """
## Hosted notebook instructions
This is just an experimental attempt of browsing wtfpython through jupyter notebooks. Some examples are read-only because,
- they either require a version of Python that's not supported in the hosted runtime.
- or they can't be reproduced in the notebook envrinonment.
The expected outputs are already present in collapsed cells following the code cells. The Google colab provides Python2 (2.7) and Python3 (3.6, default) runtimes. You can switch among these for Python2 specific examples. For examples specific to other minor versions, you can simply refer to collapsed outputs (it's not possible to control the minor version in hosted notebooks as of now). You can check the active version using
```py
>>> import sys
>>> sys.version
# Prints out Python version here.
```
That being said, most of the examples do work as expected. If you face any trouble, feel free to consult the original content on wtfpython and create an issue in the repo. Have fun!
---
"""
def generate_code_block(statements, output):
"""
Generates a code block that executes the given statements.
:param statements: The list of statements to execute.
:type statements: list(str)
"""
global sequence_num
result = {
"type": "code",
"sequence_num": sequence_num,
"statements": statements,
"output": output
}
sequence_num += 1
return result
def generate_markdown_block(lines):
"""
Generates a markdown block from a list of lines.
"""
global sequence_num
result = {
"type": "markdown",
"sequence_num": sequence_num,
"value": lines
}
sequence_num += 1
return result
def is_interactive_statement(line):
for prefix in STATEMENT_PREFIXES:
if line.lstrip().startswith(prefix):
return True
return False
def parse_example_parts(lines, title, current_line):
"""
Parse the given lines and return a dictionary with two keys:
build_up, which contains all the text before an H4 (explanation) is encountered,
and
explanation, which contains all the text after build_up until --- or another H3 is encountered.
"""
parts = {
"build_up": [],
"explanation": []
}
content = [title]
statements_so_far = []
output_so_far = []
next_line = current_line
# store build_up till an H4 (explanation) is encountered
while not (next_line.startswith("#### ")or next_line.startswith('---')):
# Watching out for the snippets
if next_line.startswith("```py"):
# It's a snippet, whatever found until now is text
is_interactive = False
output_encountered = False
if content:
parts["build_up"].append(generate_markdown_block(content))
content = []
next_line = next(lines)
while not next_line.startswith("```"):
if is_interactive_statement(next_line):
is_interactive = True
if (output_so_far):
parts["build_up"].append(generate_code_block(statements_so_far, output_so_far))
statements_so_far, output_so_far = [], []
statements_so_far.append(next_line)
else:
# can be either output or normal code
if is_interactive:
output_so_far.append(next_line)
elif output_encountered:
output_so_far.append(next_line)
else:
statements_so_far.append(next_line)
next_line = next(lines)
# Snippet is over
parts["build_up"].append(generate_code_block(statements_so_far, output_so_far))
statements_so_far, output_so_far = [], []
next_line = next(lines)
else:
# It's a text, go on.
content.append(next_line)
next_line = next(lines)
# Explanation encountered, save any content till now (if any)
if content:
parts["build_up"].append(generate_markdown_block(content))
# Reset stuff
content = []
statements_so_far, output_so_far = [], []
# store lines again until --- or another H3 is encountered
while not (next_line.startswith("---") or
next_line.startswith("### ")):
if next_line.lstrip().startswith("```py"):
# It's a snippet, whatever found until now is text
is_interactive = False
if content:
parts["explanation"].append(generate_markdown_block(content))
content = []
next_line = next(lines)
while not next_line.lstrip().startswith("```"):
if is_interactive_statement(next_line):
is_interactive = True
if (output_so_far):
parts["explanation"].append(generate_code_block(statements_so_far, output_so_far))
statements_so_far, output_so_far = [], []
statements_so_far.append(next_line)
else:
# can be either output or normal code
if is_interactive:
output_so_far.append(next_line)
else:
statements_so_far.append(next_line)
next_line = next(lines)
# Snippet is over
parts["explanation"].append(generate_code_block(statements_so_far, output_so_far))
statements_so_far, output_so_far = [], []
next_line = next(lines)
else:
# It's a text, go on.
content.append(next_line)
next_line = next(lines)
# All done
if content:
parts["explanation"].append(generate_markdown_block(content))
return next_line, parts
def remove_from_beginning(tokens, line):
for token in tokens:
if line.lstrip().startswith(token):
line = line.replace(token, "")
return line
def inspect_and_sanitize_code_lines(lines):
"""
Remove lines from the beginning of a code block that are not statements.
:param lines: A list of strings, each representing a line in the code block.
:returns is_print_present, sanitized_lines: A boolean indicating whether print was present in the original code and a list of strings representing
sanitized lines. The latter may be an empty list if all input lines were removed as comments or whitespace (and thus did not contain any statements).
This function does not remove blank lines at the end of `lines`.
"""
tokens_to_remove = STATEMENT_PREFIXES
result = []
is_print_present = False
for line in lines:
line = remove_from_beginning(tokens_to_remove, line)
if line.startswith("print ") or line.startswith("print("):
is_print_present = True
result.append(line)
return is_print_present, result
def convert_to_cells(cell_contents, read_only):
"""
Converts a list of dictionaries containing markdown and code cells into a Jupyter notebook.
:param cell_contents: A list of dictionaries, each
dictionary representing either a markdown or code cell. Each dictionary should have the following keys: "type", which is either "markdown" or "code",
and "value". The value for type = 'markdown' is the content as string, whereas the value for type = 'code' is another dictionary with two keys,
statements and output. The statements key contains all lines in between ```py\n``` (including) until ```\n```, while output contains all lines after
```.output py\n```.
:type cell_contents: List[Dict]
:param read_only (optional): If True then only print outputs are included in converted
cells. Default False
:type read_only (optional): bool
:returns A Jupyter notebook containing all cells from input parameter `cell_contents`.
Each converted cell has metadata attribute collapsed set to true if it's code-cell otherwise None if it's markdow-cell.
"""
cells = []
for stuff in cell_contents:
if stuff["type"] == "markdown":
# todo add metadata later
cells.append(
{
"cell_type": "markdown",
"metadata": {},
"source": stuff["value"]
}
)
elif stuff["type"] == "code":
if read_only:
# Skip read only
# TODO: Fix
cells.append(
{
"cell_type": "markdown",
"metadata": {},
"source": ["```py\n"] + stuff["statements"] + ["```\n"] + ["```py\n"] + stuff['output'] + ["```\n"]
}
)
continue
is_print_present, sanitized_code = inspect_and_sanitize_code_lines(stuff["statements"])
if is_print_present:
cells.append(
{
"cell_type": "code",
"metadata": {
"collapsed": True,
},
"execution_count": None,
"outputs": [{
"name": "stdout",
"output_type": "stream",
"text": stuff["output"]
}],
"source": sanitized_code
}
)
else:
cells.append(
{
"cell_type": "code",
"execution_count": None,
"metadata": {
"collapsed": True
},
"outputs": [{
"data": {
"text/plain": stuff["output"]
},
"output_type": "execute_result",
"metadata": {},
"execution_count": None
}],
"source": sanitized_code
}
)
return cells
def convert_to_notebook(pre_examples_content, parsed_json, post_examples_content):
"""
Convert a JSON file containing the examples to a Jupyter Notebook.
"""
result = {
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}
notebook_path = "wtf.ipynb"
result["cells"] += convert_to_cells([generate_markdown_block(pre_examples_content)], False)
for example in parsed_json:
parts = example["parts"]
build_up = parts.get("build_up")
explanation = parts.get("explanation")
read_only = example.get("read_only")
if build_up:
result["cells"] += convert_to_cells(build_up, read_only)
if explanation:
result["cells"] += convert_to_cells(explanation, read_only)
result["cells"] += convert_to_cells([generate_markdown_block(post_examples_content)], False)
#pprint.pprint(result, indent=2)
with open(notebook_path, "w") as f:
json.dump(result, f, indent=2)
with open(fpath, 'r+', encoding="utf-8") as f:
lines = iter(f.readlines())
line = next(lines)
result = []
pre_examples_phase = True
pre_stuff = []
post_stuff = []
try:
while True:
if line.startswith("## "):
pre_examples_phase = False
# A section is encountered
current_section_name = line.replace("## ", "").strip()
section_text = []
line = next(lines)
# Until a new section is encountered
while not (line.startswith("## ") or line.startswith("# ")):
# check if it's a H3
if line.startswith("### "):
# An example is encountered
title_line = line
line = next(lines)
read_only = False
while line.strip() == "" or line.startswith('<!--'):
#TODO: Capture example ID here using regex.
if '<!-- read-only -->' in line:
read_only = True
line = next(lines)
example_details = {
"id": current_example,
"title": title_line.replace("### ", ""),
"section": current_section_name,
"read_only": read_only
}
line, example_details["parts"] = parse_example_parts(lines, title_line, line)
result.append(example_details)
current_example += 1
else:
section_text.append(line)
line = next(lines)
else:
if pre_examples_phase:
pre_stuff.append(line)
else:
post_stuff.append(line)
line = next(lines)
except StopIteration as e:
#pprint.pprint(result, indent=2)
pre_stuff.append(HOSTED_NOTEBOOK_INSTRUCTIONS)
result.sort(key = lambda x: x["read_only"])
convert_to_notebook(pre_stuff, result, post_stuff)

7
irrelevant/notebook_instructions.md vendored Normal file
View File

@ -0,0 +1,7 @@
## Generating the notebook
- Expand the relative links in README.md to absolute ones
- Remove the TOC in README.md (because Google colab generates its own anyway)
- Reorder the examples, so that the ones that work are upfront.
- Run the `notebook_generator.py`, it will generate a notebook named `wtf.ipynb`
- Revert the README.md changes (optional)

View File

@ -139,7 +139,7 @@ f*
Half triple-quoted strings Half triple-quoted strings
f f
Implicity key type conversion Implicit key type conversion
f* f*
Stubborn `del` operator Stubborn `del` operator

View File

@ -1,6 +1,8 @@
""" """
Parses the README.md and generated the table This script parses the README.md and generates the table
`CONTRIBUTORS.md`. `CONTRIBUTORS.md`.
No longer works since we've moved on contributors to CONTRIBUTORS.md entirely.
""" """
import pprint import pprint
@ -39,7 +41,7 @@ for handle, issues in contribs.items():
issue_string = ', '.join([issue_format.format(i, i) for i in issues]) issue_string = ', '.join([issue_format.format(i, i) for i in issues])
resp = requests.get(github_rest_api.format(handle)) resp = requests.get(github_rest_api.format(handle))
name = handle name = handle
if resp.status_code is 200: if resp.status_code == 200:
pprint.pprint(resp.json()['name']) pprint.pprint(resp.json()['name'])
else: else:
print(handle, resp.content) print(handle, resp.content)
@ -48,4 +50,4 @@ for handle, issues in contribs.items():
handle, handle,
issue_string)) issue_string))
print(table_header + "\n".join(rows_so_far)) print(table_header + "\n".join(rows_so_far))

View File

@ -2,7 +2,7 @@
""" """
This inefficient module would parse the README.md in the initial version of This inefficient module would parse the README.md in the initial version of
WTFPython, and enabl me to categorize and reorder a hell lot of examples with WTFPython, and enable me to categorize and reorder a hell lot of examples with
the help of the file `add_categories` (part of which is automatically the help of the file `add_categories` (part of which is automatically
generated). generated).
@ -10,6 +10,12 @@ After the refactor, this module would not work now with necessary updates in
the code. the code.
""" """
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
fname = "README.md" fname = "README.md"
snippets = [] snippets = []
@ -80,6 +86,7 @@ with open("add_categories", "r") as f:
} }
content.next() content.next()
except StopIteration: except StopIteration:
pass
for idx, snip in enumerate(snippets): for idx, snip in enumerate(snippets):
snippets[idx]["category"] = snips_by_title[snip["title"]]["category"] snippets[idx]["category"] = snips_by_title[snip["title"]]["category"]

13469
irrelevant/wtf.ipynb vendored Normal file

File diff suppressed because it is too large Load Diff

41
package.json vendored
View File

@ -1,41 +0,0 @@
{
"name": "wtfpython",
"version": "2.0.0",
"description": "A collection of trick Python snippets and lesser known features",
"bin": "wtfpython",
"scripts": {
"postpublish": "git push origin master",
"toc": "doctoc --github --title '# Table of Contents' --maxlevel 3 README.md"
},
"repository": {
"type": "git",
"url": "git+https://github.com/satwikkansal/wtfPython.git"
},
"keywords": [
"python",
"specification",
"notes",
"wtf",
"learning",
"guide",
"handbook"
],
"author": "Satwik Kansal <satwikkansal@gmail.com> (https://satwikkansal.xyz)",
"license": "WTFPL 2.0",
"bugs": {
"url": "https://github.com/satwikkansal/wtfPython/issues"
},
"homepage": "https://github.com/satwikkansal/wtfPython#readme",
"devDependencies": {
"doctoc": "^1.3.0"
},
"dependencies": {
"boxen": "^1.1.0",
"chalk": "^1.1.1",
"default-pager": "^1.1.0",
"meow": "^3.7.0",
"msee": "^0.3.3",
"through2": "^2.0.2",
"update-notifier": "^2.0.0"
}
}

63
translations/ru-russian/CONTRIBUTING.md vendored Normal file
View File

@ -0,0 +1,63 @@
Приветствуются все виды изменений. Не стесняйтесь предлагать броские и смешные названия для существующих примеров. Цель - сделать эту коллекцию как можно более интересной для чтения. Вот несколько способов, с помощью которых вы можете внести свой вклад,
- Если вы заинтересованы в переводе проекта на другой язык (некоторые люди уже делали это в прошлом), пожалуйста, не стесняйтесь открыть тему и дайте мне знать, если вам нужна какая-либо помощь.
- Если изменения, которые вы предлагаете, значительны, то создание issue перед внесением изменений будет оценено по достоинству. Если вы хотите поработать над issue (это очень рекомендуется), выразите свою заинтересованность и вы будете назначены исполнителем.
- Если вы добавляете новый пример, настоятельно рекомендуется создать issue, чтобы обсудить ее перед отправкой изменений. Для добавления нового примера вы можете использовать следующий шаблон:
<pre>
### ▶ Какое-то причудливое название. *
* в конце названия означает, что пример был добавлен недавно.
```py
# Подготовка кода.
# Подготовка к волшебству...
```
**Вывод (версия Python):**
```py
>>> triggering_statement
Вероятно, неожиданный вывод
```
(Необязательно): Одна строка, описывающая неожиданный вывод.
#### 💡 Объяснение:
* Краткое объяснение того, что происходит и почему это происходит.
```py
Подготовка примеров для пояснения (при необходимости)
```
**Вывод:**
```py
>>> trigger # пример, облегчающий понимание магии
# обоснованный вывод
```
</pre>
Несколько моментов, которые стоит учитывать при написании примера,
- Если вы решили отправить новый пример без создания issue и обсуждения, пожалуйста, проверьте проект, чтобы убедиться, что в нем уже нет похожих примеров.
- Старайтесь быть последовательными в именах и значениях, которые вы используете для переменных. Например, большинство имен переменных в проекте имеют вид `some_string`, `some_list`, `some_dict` и т.д. Вы увидите много `x` для однобуквенных имен переменных, и `"wtf"` в качестве значений для строк. В проекте нет строгой схемы, как таковой, но вы можете взглянуть на другие примеры, чтобы понять суть.
- Старайтесь быть как можно более креативными, чтобы добавить элемент "сюрприза" во время подготовки примеров. Иногда это может означать написание фрагмента, который здравомыслящий программист никогда бы не написал.
- Также не стесняйтесь добавлять свое имя в список [контрибьюторов](/CONTRIBUTORS.md).
**Некоторые часто задаваемые вопросы**
Что это такое после каждого заголовка сниппета (###) в README: <!-- ID примера: 30f1d3fc-e267-4b30-84ef-4d9e7091ac1a --->? Нужно ли его добавлять вручную или можно игнорировать при создании новых сниппетов?
Это случайный UUID, он используется для идентификации примеров в нескольких переводах проекта. Как контрибьютор, вы не должны беспокоиться о том, как он используется, вы просто должны добавлять новый случайный UUID к новым примерам в этом формате.
Куда следует добавлять новые сниппеты? В начало/в конец раздела?
При определении порядка учитывается множество факторов (зависимость от других примеров, уровень сложности, категория и т.д.). Я бы предложил просто добавить новый пример в конец раздела, который вы считаете более подходящим (или просто добавить его в раздел "Разное"). О его порядке можно будет позаботиться в будущих редакциях.
В чем разница между разделами (первые два очень похожи)?
Раздел "Напрягите мозг" содержит более надуманные примеры, с которыми вы не столкнетесь в реальной жизни, в то время как раздел "Скользкие склоны" содержит примеры, с которыми можно чаще сталкиваться при программировании.
Перед оглавлением написано, что для его создания использовался markdown-toc -i README.md --maxdepth 3. Пакет pip markdown-toc не содержит ни флагов -i, ни --maxdepth. Какой пакет имеется в виду, или какая версия этого пакета?
Должна ли новая запись в оглавлении для фрагмента быть создана с помощью вышеуказанной команды или вручную (в случае, если вышеуказанная команда делает больше, чем просто добавляет запись)?
Мы используем пакет [markdown-toc](https://www.npmjs.com/package/markdown-toc) npm для создания ToC (содержание). Однако у него есть некоторые проблемы со специальными символами (не уверен, что они уже исправлены). Чаще всего я просто вставляю ссылку toc вручную в нужное место. Инструмент удобен, когда мне нужно сделать большую перестановку, в остальных случаях просто обновлять toc вручную удобнее.
Если у вас есть вопросы, не стесняйтесь спрашивать в [issue](https://github.com/satwikkansal/wtfpython/issues/269) (спасибо [@LiquidFun](https://github.com/LiquidFun) за ее создание).

42
translations/ru-russian/CONTRIBUTORS.md vendored Normal file
View File

@ -0,0 +1,42 @@
Ниже перечислены (без определенного порядка) замечательные люди, которые внесли вклад в развитие wtfpython.
| Автор | Github | Issues |
|-------------|--------|--------|
| Lucas-C | [Lucas-C](https://github.com/Lucas-C) | [#36](https://github.com/satwikkansal/wtfpython/issues/36) |
| MittalAshok | [MittalAshok](https://github.com/MittalAshok) | [#23](https://github.com/satwikkansal/wtfpython/issues/23) |
| asottile | [asottile](https://github.com/asottile) | [#40](https://github.com/satwikkansal/wtfpython/issues/40) |
| MostAwesomeDude | [MostAwesomeDude](https://github.com/MostAwesomeDude) | [#1](https://github.com/satwikkansal/wtfpython/issues/1) |
| tukkek | [tukkek](https://github.com/tukkek) | [#11](https://github.com/satwikkansal/wtfpython/issues/11), [#26](https://github.com/satwikkansal/wtfpython/issues/26) |
| PiaFraus | [PiaFraus](https://github.com/PiaFraus) | [#9](https://github.com/satwikkansal/wtfpython/issues/9) |
| 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) |
| ipid | [ipid](https://github.com/ipid) | [#145](https://github.com/satwikkansal/wtfpython/issues/145) |
| roshnet | [roshnet](https://github.com/roshnet) | [#140](https://github.com/satwikkansal/wtfpython/issues/140) |
| daidai21 | [daidai21](https://github.com/daidai21) | [#137](https://github.com/satwikkansal/wtfpython/issues/137) |
| scidam | [scidam](https://github.com/scidam) | [#136](https://github.com/satwikkansal/wtfpython/issues/136) |
| pmjpawelec | [pmjpawelec](https://github.com/pmjpawelec) | [#121](https://github.com/satwikkansal/wtfpython/issues/121) |
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [#112](https://github.com/satwikkansal/wtfpython/issues/112) |
| mishaturnbull | [mishaturnbull](https://github.com/mishaturnbull) | [#108](https://github.com/satwikkansal/wtfpython/issues/108) |
| MuseBoy | [MuseBoy](https://github.com/MuseBoy) | [#101](https://github.com/satwikkansal/wtfpython/issues/101) |
| Ghost account | N/A | [#96](https://github.com/satwikkansal/wtfpython/issues/96) |
| koddo | [koddo](https://github.com/koddo) | [#80](https://github.com/satwikkansal/wtfpython/issues/80), [#73](https://github.com/satwikkansal/wtfpython/issues/73) |
| jab | [jab](https://github.com/jab) | [#77](https://github.com/satwikkansal/wtfpython/issues/77) |
| Jongy | [Jongy](https://github.com/Jongy) | [#208](https://github.com/satwikkansal/wtfpython/issues/208), [#210](https://github.com/satwikkansal/wtfpython/issues/210), [#233](https://github.com/satwikkansal/wtfpython/issues/233) |
| Diptangsu Goswami | [diptangsu](https://github.com/diptangsu) | [#193](https://github.com/satwikkansal/wtfpython/issues/193) |
| Charles | [charles-l](https://github.com/charles-l) | [#245](https://github.com/satwikkansal/wtfpython/issues/245) |
| LiquidFun | [LiquidFun](https://github.com/LiquidFun) | [#267](https://github.com/satwikkansal/wtfpython/issues/267) |
---
**Переводчики**
| Переводчик | Github | Язык |
|-------------|--------|--------|
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [Chinese](https://github.com/leisurelicht/wtfpython-cn) |
| vuduclyunitn | [vuduclyunitn](https://github.com/vuduclyunitn) | [Vietnamese](https://github.com/vuduclyunitn/wtfptyhon-vi) |
| José De Freitas | [JoseDeFreitas](https://github.com/JoseDeFreitas) | [Spanish](https://github.com/JoseDeFreitas/wtfpython-es) |
| Vadim Nifadev | [nifadyev](https://github.com/nifadyev) | [Russian](https://github.com/satwikkansal/wtfpython/tree/master/translations/ru-russian) |
Спасибо всем за ваше время и за то, что делаете wtfpython еще более потрясающим! :smile:
PS: Этот список обновляется после каждого крупного релиза, если я забыл добавить сюда ваш вклад, пожалуйста, не стесняйтесь сделать Pull request.

3965
translations/ru-russian/README.md vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,70 @@
# Кодекс Поведения участника
## Наши обязательства
Мы, как участники, авторы и лидеры обязуемся сделать участие в сообществе
свободным от притеснений для всех, независимо от возраста, телосложения,
видимых или невидимых ограничений способности, этнической принадлежности,
половых признаков, гендерной идентичности и выражения, уровня опыта,
образования, социально-экономического статуса, национальности, внешности,
расы, религии, или сексуальной идентичности и ориентации.
Мы обещаем действовать и взаимодействовать таким образом, чтобы вносить вклад в открытое,
дружелюбное, многообразное, инклюзивное и здоровое сообщество.
## Наши стандарты
Примеры поведения, создающие условия для благоприятных взаимоотношений включают в себя:
* Проявление доброты и эмпатии к другим участникам проекта
* Уважение к чужой точке зрения и опыту
* Конструктивная критика и принятие конструктивной критики
* Принятие ответственности, принесение извинений тем, кто пострадал от наших ошибок
и извлечение уроков из опыта
* Ориентирование на то, что лучше подходит для сообщества, а не только для нас лично
Примеры неприемлемого поведения участников включают в себя:
* Использование выражений или изображений сексуального характера и нежелательное сексуальное внимание или домогательство в любой форме
* Троллинг, оскорбительные или уничижительные комментарии, переход на личности или затрагивание политических убеждений
* Публичное или приватное домогательство
* Публикация личной информации других лиц, например, физического или электронного адреса, без явного разрешения
* Иное поведение, которое обоснованно считать неуместным в профессиональной обстановке
## Обязанности
Лидеры сообщества отвечают за разъяснение и применение наших стандартов приемлемого
поведения и будут предпринимать соответствующие и честные меры по исправлению положения
в ответ на любое поведение, которое они сочтут неприемлемым, угрожающим, оскорбительным или вредным.
Лидеры сообщества обладают правом и обязанностью удалять, редактировать или отклонять
комментарии, коммиты, код, изменения в вики, вопросы и другой вклад, который не совпадает
с Кодексом Поведения, и предоставят причины принятого решения, когда сочтут нужным.
## Область применения
Данный Кодекс Поведения применим во всех публичных физических и цифровых пространства сообщества,
а также когда человек официально представляет сообщество в публичных местах.
Примеры представления проекта или сообщества включают использование официальной электронной почты,
публикации в официальном аккаунте в социальных сетях,
или упоминания как представителя в онлайн или офлайн мероприятии.
## Приведение в исполнение
О случаях домогательства, а так же оскорбительного или иного другого неприемлемого
поведения можно сообщить ответственным лидерам сообщества с помощью email.
Все жалобы будут рассмотрены и расследованы оперативно и беспристрастно.
Все лидеры сообщества обязаны уважать неприкосновенность частной жизни и личную
неприкосновенность автора сообщения.
## Атрибуция
Данный Кодекс Поведения основан на [Кодекс Поведения участника][homepage],
версии 2.0, доступной по адресу
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Принципы Воздействия в Сообществе были вдохновлены [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org

85
wtfpython vendored
View File

@ -1,85 +0,0 @@
#!/usr/bin/env node
const fs = require('fs');
const obj = require('through2').obj;
const pager = require('default-pager');
const msee = require('msee');
const join = require('path').join;
const boxen = require('boxen');
const chalk = require('chalk');
const updateNotifier = require('update-notifier');
const pkg = require('./package.json');
const meow = require('meow');
const cli = meow([
'Usage',
' bash-handbook',
'',
'Options',
' --lang, -l Translation language',
'',
'Examples',
' bash-handbook',
' bash-handbook --lang pt-br'
], {
string: [
'lang'
],
alias: {
l: 'lang',
h: 'help'
},
default: {
lang: ''
}
});
const boxenOpts = {
borderColor: 'yellow',
margin: {
bottom: 1
},
padding: {
right: 1,
left: 1
}
};
const mseeOpts = {
paragraphEnd: '\n\n'
};
const notifier = updateNotifier({ pkg });
process.env.PAGER = process.env.PAGER || 'less';
process.env.LESS = process.env.LESS || 'FRX';
const lang = cli.flags.lang
.toLowerCase()
.split('-')
.map((l, i) => i === 0 ? l : l.toUpperCase())
.join('-');
const translation = join(__dirname, !lang ? './README.md' : `./README-${lang}.md`);
fs.stat(translation, function (err, stats) {
if (err) {
console.log('The %s translation does not exist', chalk.bold(lang));
return;
}
fs.createReadStream(translation)
.pipe(obj(function (chunk, enc, cb) {
const message = [];
if (notifier.update) {
message.push(`Update available: {green.bold ${notifier.update.latest}} {dim current: ${notifier.update.current}}`);
message.push(`Run {blue npm install -g ${pkg.name}} to update.`);
this.push(boxen(message.join('\n'), boxenOpts));
}
this.push(msee.parse(chunk.toString(), mseeOpts));
cb();
}))
.pipe(pager());
});

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -1,41 +0,0 @@
from setuptools import setup, find_packages
if __name__ == "__main__":
setup(name='wtfpython',
version='0.1.3',
description='What the f*ck Python!',
author="Satwik Kansal",
maintainer="Satwik Kansal",
maintainer_email='satwikkansal@gmail.com',
url='https://github.com/satwikkansal/wtfpython',
platforms='any',
license="WTFPL 2.0",
long_description="An interesting collection of subtle & tricky Python Snippets"
" and features.",
keywords="wtfpython gotchas snippets tricky",
packages=find_packages(),
entry_points = {
'console_scripts': ['wtfpython = wtf_python.main:load_and_read']
},
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Environment :: MacOS X',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: End Users/Desktop',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2',
'Topic :: Documentation',
'Topic :: Education',
'Topic :: Scientific/Engineering',
'Topic :: Software Development'],
)

Binary file not shown.

View File

@ -1,35 +0,0 @@
import pydoc
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
url = ("https://raw.githubusercontent.com/satwikkansal/"
"wtfpython/master/README.md")
file_name = "content.md"
def fetch_updated_doc():
try:
print("Fetching the latest version...")
urlretrieve(url, file_name)
print("Done!")
except Exception as e:
print(e)
print("Uh oh, failed to check for the latest version, "
"using the local version for now.")
def render_doc():
with open(file_name, 'r') as f:
content = f.read()
pydoc.pager(content)
def load_and_read():
fetch_updated_doc()
render_doc()
if __name__== "__main__":
load_and_read()

Binary file not shown.

View File

@ -1,8 +0,0 @@
#!/usr/bin/env python3
import sys
from wtf_python.main import load_and_read
if __name__ == "__main__":
sys.exit(load_and_read())