Compare commits

...

226 Commits

Author SHA1 Message Date
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
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
15 changed files with 18566 additions and 576 deletions

40
CONTRIBUTING.md vendored
View File

@ -1,12 +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 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.
You can use the following template for adding a new example:
- 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, 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:
<pre>
### ▶ Some fancy Title *
@ -29,7 +25,7 @@ Probably unexpected output
```py
Setting up examples for clarification (if necessary)
```
**Outupt:**
**Output:**
```py
>>> trigger # some example that makes it easy to unveil the magic
# some justified output
@ -40,6 +36,28 @@ Probably unexpected output
Few things that you can consider while writing an example,
- 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 strictly enforced scheme in the project, but you can take a glance at other examples to get a gist.
- 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, please don't forget to add your name to the [contributors list](/CONTRIBUTING.md).
- 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).

16
CONTRIBUTORS.md vendored
View File

@ -18,10 +18,24 @@ Following are the wonderful people (in no specific order) who have contributed t
| 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)
| 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) |
---
**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:

1412
README.md vendored

File diff suppressed because it is too large Load Diff

BIN
images/expanding-brain-meme.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
images/logo-dark.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -55,6 +55,12 @@ That being said, most of the examples do work as expected. If you face any troub
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",
@ -67,6 +73,9 @@ def generate_code_block(statements, output):
def generate_markdown_block(lines):
"""
Generates a markdown block from a list of lines.
"""
global sequence_num
result = {
"type": "markdown",
@ -85,6 +94,12 @@ def is_interactive_statement(line):
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": []
@ -191,6 +206,14 @@ def remove_from_beginning(tokens, 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
@ -203,6 +226,23 @@ def inspect_and_sanitize_code_lines(lines):
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":
@ -269,6 +309,9 @@ def convert_to_cells(cell_contents, read_only):
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": {},
@ -296,7 +339,7 @@ def convert_to_notebook(pre_examples_content, parsed_json, post_examples_content
#pprint.pprint(result, indent=2)
with open(notebook_path, "w") as f:
json.dump(result, f)
json.dump(result, f, indent=2)
with open(fpath, 'r+', encoding="utf-8") as f:

View File

@ -5,22 +5,3 @@
- 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)
# 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 tbe 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!

View File

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

13479
irrelevant/wtf.ipynb vendored

File diff suppressed because one or more lines are too long

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.

3948
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

View File

@ -1732,7 +1732,7 @@ UnboundLocalError: local variable 'a' referenced before assignment
#### 💡 Explanation:
* When you make an assignment to a variable in scope, it becomes local to that scope. So `a` becomes local to the scope of `another_func`, but it has not been initialized previously in the same scope which throws an error.
* Read [this](http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html) short but an awesome guide to learn more about how namespaces and scope resolution works in Python.
* Read [this](https://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html) short but an awesome guide to learn more about how namespaces and scope resolution works in Python.
* To modify the outer scope variable `a` in `another_func`, use `global` keyword.
```py
def another_func()

View File

@ -13,6 +13,10 @@ file_path = join(dirname(dirname(realpath(__file__))), "content.md")
def fetch_updated_doc():
"""
Fetch the latest version of the file at `url` and save it to `file_path`.
If anything goes wrong, do nothing.
"""
try:
print("Fetching the latest version...")
urlretrieve(url, file_path)