Commit Graph

307 Commits

Author SHA1 Message Date
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
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
mitcom d143f972b8 Add space-invader operator case 2019-10-06 13:12:35 +02:00
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 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 c5665da81d Nitpicks in the new example 2019-09-13 15:01:45 +05:30
Kislov Dmitry cedbfba829 New snippet: yielding from... return! 2019-09-13 12:03:27 +10:00
Nikita Sobolev b0622a10ad
Fixes code highlight 2019-07-30 00:34:58 +03:00
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
zachkirsch e611f24e7f
Change constant-folding max from <20 to <=20 2019-07-03 11:39:57 -04: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 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
Satwik Kansal b262f29756
Add reference to chinese translation 2018-12-16 16:23:39 +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
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 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
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
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
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 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 b362cc9d0a Add new links 2018-01-23 14:31:31 +05:30
Satwik Kansal 601d1e4396 Update section names 2018-01-22 19:35:37 +05:30
Satwik Kansal 86f4b67525 Fix broken TOC 2018-01-22 19:33:01 +05:30
Satwik Kansal 4ab6e94f03 Change title 2018-01-22 19:21:10 +05:30
Satwik Kansal dc2dc3528a Add one line description for the sections. 2018-01-22 19:17:01 +05:30
Satwik Kansal 2ef3b8bbfc Fix typ 2018-01-22 18:51:58 +05:30
Satwik Kansal 502769882a Update to the new awesome generated doc 🎉 2018-01-22 18:49:09 +05:30
Satwik Kansal 12ba09b40b Slight modifications in the description 2018-01-22 18:49:09 +05:30
Satwik Kansal dc9387effa Add a note about asterisk 2018-01-22 18:49:09 +05:30
Satwik Kansal 3b956caba2 Update contributing guidelines 2018-01-22 18:49:09 +05:30
Satwik Kansal a253ec4cda Fix a hell lot of typos 2018-01-22 18:49:09 +05:30
Satwik Kansal 852bdc3d32 Update usage instructions 2018-01-22 18:49:09 +05:30
Satwik Kansal d325554921 * Fix .gitignore issue
* Add pypi package 🚀
2018-01-22 18:49:09 +05:30
Satwik Kansal c979d82c1f Grammatical changes 2018-01-22 18:49:09 +05:30
Satwik Kansal 1032f356d5 Add pdf section 2018-01-22 18:49:09 +05:30
Satwik Kansal 92fa8039db Remove "Suggested by" from the examples.
* Because a major refactor of examples has to be done.
* Our awesome contributors are duly credited in the new CONTRIBUTORS.md
2018-01-22 18:49:09 +05:30
Satwik Kansal 7d667bb3fd Slightly update the description 2018-01-22 18:49:09 +05:30
Satwik Kansal 35057d4131 Update Acknowledgements section 2018-01-22 18:49:09 +05:30
Satwik Kansal bf161dd0d2 update help section 2018-01-22 18:49:09 +05:30
Satwik Kansal ba6870a46e Shots fired!y 2018-01-22 18:49:09 +05:30
Satwik Kansal 33b38f1835 More examples and easter eggs.
Damn, this is going to be awesome!!!
2018-01-22 18:49:09 +05:30
Satwik Kansal e2e8e42d52 Update backslash example 2018-01-22 18:49:09 +05:30
Satwik Kansal 491a98e478 Add one more statement to explanation snippet 2018-01-22 18:49:09 +05:30
Satwik Kansal a13213dfeb Update broken link 2018-01-14 22:55:41 +05:30
Satwik Kansal f220dd36e0 Update the description and add social links 2018-01-14 21:11:05 +05:30
Satwik Kansal b743451660 Add new example: Tricky strings
Closes https://github.com/satwikkansal/wtfpython/issues/54
2018-01-11 22:17:27 +05:30
Satwik Kansal 1ec3c5e5e9 Dictionary modification: Add python versions in the output
Also adds a note explaining the reason behind it.

Related to https://github.com/satwikkansal/wtfpython/issues/54
2018-01-11 15:16:54 +05:30
Satwik Kansal f1c2b68d32 Add new example: The stubborn del operator
Closes https://github.com/satwikkansal/wtfpython/issues/26
2018-01-11 14:13:17 +05:30
Satwik Kansal e94cbea6bc Update TOC
Closes https://github.com/satwikkansal/wtfpython/issues/36
2018-01-07 15:05:44 +05:30
Satwik Kansal 2ef51ecb8f Add a lot of examples 2018-01-07 15:05:00 +05:30
Satwik Kansal b624ed908d Update minor examples: Add one and remove one 2018-01-07 12:44:22 +05:30
Satwik Kansal c84c827248 Add new example: Teleportation 2018-01-07 12:27:16 +05:30
Satwik Kansal 118f51d042 Add new example: Deep Down, we're all the same 2018-01-07 11:57:50 +05:30
Satwik Kansal 78a1218dbd Minor corrections in previous example 2018-01-07 11:27:23 +05:30
Satwik Kansal 7909c0b1ad Add example: Mangling time! 2018-01-07 11:25:34 +05:30
Satwik Kansal 0da5243425 Add new example: Subclass transitivity 2018-01-07 11:06:47 +05:30
Satwik Kansal 47e0fc86e6
Update README.md 2017-12-24 01:03:36 +05:30
Parth Laxmikant Kolekar 0ce64da2fd Update README.md
Typo fix
2017-10-20 23:01:40 +05:30
Satwik Kansal 41e9b72fea Add new snippet: Half quoted triple strings
Closes https://github.com/satwikkansal/wtfpython/issues/40
2017-10-11 22:47:59 +05:30
Satwik Kansal ea29aa034d Update Example: Let's make a giant string
* Add another function `add_bytes_with_plus` actually illustrating
  quadratic behavior for the `+=` operator.
* Add explaination for linear behavior due to `+=` optimizations
  in case of strings.
* Change the order of examples (move string interning example just
  before the giant string example).

Closes https://github.com/satwikkansal/wtfpython/issues/38
2017-10-11 18:49:09 +05:30
Satwik Kansal e2c2cf106b Add new snippet: Yielding None
Closes https://github.com/satwikkansal/wtfpython/issues/32
2017-10-11 17:44:42 +05:30
Satwik Kansal 2fff92ca56 Add gitter channel information and update TOC
Closes https://github.com/satwikkansal/wtfpython/issues/43
2017-10-11 15:58:22 +05:30
Valentin Samir 6f66e1e065 Fix typo, expression output True and not [[...]] 2017-10-03 16:50:39 +02:00
Satwik Kansal e836b22a36 String concatenation optimizations: Update title
* Modifies the previously misleading title to be
more precise.

Related to https://github.com/satwikkansal/wtfpython/issues/38
2017-09-11 22:09:58 +05:30
Satwik Kansal 17a456adf1 Update contributing guide. 2017-09-11 21:52:45 +05:30
Satwik Kansal 76da1b8740 Skipping lines: Update explanation
* Add more accurate explanation
* Add more relevant example

Closes https://github.com/satwikkansal/wtfpython/issues/39
2017-09-11 21:41:00 +05:30
zed 0a70a2e645 add link to a more specific Stack Overflow thread
[What happens when you try to delete a list element while iterating over it](https://stackoverflow.com/questions/45946228/what-happens-when-you-try-to-delete-a-list-element-while-iterating-over-it)
2017-09-07 20:39:02 +03:00
sunqingyao c2d42a5e52 Formatting 2017-09-07 16:52:34 +08:00
Jacob Mansfield 5d8a9e60c8
"Is not" description is too descriptive, changed title to "is not is not
is (not)"
2017-09-06 17:47:28 +01:00
Satwik Kansal fa368e8caf Table Of Contents: Add entries
* Adds new examples to the table of contents.
2017-09-06 19:01:05 +05:30
Satwik Kansal be98d88440 Add example: The surprising comma
Closes https://github.com/satwikkansal/wtfpython/issues/1
2017-09-06 16:40:38 +05:30
Satwik Kansal cc3eb36f92 Minor Examples: Update explanation for multithreading example
* Clarifies that Python threads do run concurrently and are
  useful for I/O bound tasks.

Fixes https://github.com/satwikkansal/wtfpython/issues/30
2017-09-06 16:22:59 +05:30
Satwik Kansal 24c4a6469e Minor exmpample: Correct explanation
* `'a'[0][0][0][0][0]` is semanically correctly not because
  strings are iterables but because they are sequences as well.

Related to https://github.com/satwikkansal/wtfpython/issues/30
2017-09-06 16:22:59 +05:30
Satwik Kansal 5467a67f0f Add minor example
Adds an example to illustrate absence of
Increment and Decrement operators in Python.

Related to https://github.com/satwikkansal/wtfpython/issues/30
2017-09-06 16:22:59 +05:30
Beni Cherniavsky-Paskin 2155d917df italic literal *`op=`* 2017-09-06 11:30:25 +03:00
Beni Cherniavsky-Paskin c95ba00160 a+=b vs a=a+b : clarify the difference is not universal
Made the text say it depends on class, and rest of explanation talk of lists, not objects.
2017-09-06 09:12:37 +03:00