| route-pattern | /:user_id/:repository |
| route-controller | files |
| route-action | disambiguate |
| fetch-nonce | v2:7f4575f2-b901-9693-bba5-d3226287b26b |
| current-catalog-service-hash | f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb |
| request-id | 9346:3BAB6B:92AE7C:C03615:696B1B3A |
| html-safe-nonce | 0b28c928c6c592c3a0df348b99d067eeaf4eb158e2500d31c4719dc8a09e0177 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzQ2OjNCQUI2Qjo5MkFFN0M6QzAzNjE1OjY5NkIxQjNBIiwidmlzaXRvcl9pZCI6IjczMTA0NDg1NjMzODY1MjI0MjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5a62ef0860f6e16731226c53f2e166b6377efc1a239497c238f4f99e8e593f5a |
| hovercard-subject-tag | repository:230767975 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | // |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/vikibytes/wtfpython |
| twitter:image | https://opengraph.githubassets.com/824d1263346c634c1cce8fcc7de766f4cbe23fa157a4e0592e14b9c32daec0d9/vikibytes/wtfpython |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/824d1263346c634c1cce8fcc7de766f4cbe23fa157a4e0592e14b9c32daec0d9/vikibytes/wtfpython |
| og:image:alt | Exploring Python through counter-intuitive snippets. If you think you know Python, think once more! - vikibytes/wtfpython |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/vikibytes/wtfpython git https://github.com/vikibytes/wtfpython.git |
| octolytics-dimension-user_id | 6869011 |
| octolytics-dimension-user_login | vikibytes |
| octolytics-dimension-repository_id | 230767975 |
| octolytics-dimension-repository_nwo | vikibytes/wtfpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 101684374 |
| octolytics-dimension-repository_parent_nwo | satwikkansal/wtfpython |
| octolytics-dimension-repository_network_root_id | 101684374 |
| octolytics-dimension-repository_network_root_nwo | satwikkansal/wtfpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/vikibytes/wtfpython#start-of-content |
|
| https://github.com/ |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvikibytes%2Fwtfpython |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub SparkBuild and deploy intelligent apps | https://github.com/features/spark |
| GitHub ModelsManage and compare prompts | https://github.com/features/models |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| GitHub SponsorsFund open source developers | https://github.com/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/accelerator |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | https://github.com/security/advanced-security |
| Copilot for BusinessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvikibytes%2Fwtfpython |
|
Sign up
| https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=vikibytes%2Fwtfpython |
| Reload | https://github.com/vikibytes/wtfpython |
| Reload | https://github.com/vikibytes/wtfpython |
| Reload | https://github.com/vikibytes/wtfpython |
|
vikibytes
| https://github.com/vikibytes |
| wtfpython | https://github.com/vikibytes/wtfpython |
| satwikkansal/wtfpython | https://github.com/satwikkansal/wtfpython |
|
Notifications
| https://github.com/login?return_to=%2Fvikibytes%2Fwtfpython |
|
Fork
0
| https://github.com/login?return_to=%2Fvikibytes%2Fwtfpython |
|
Star
0
| https://github.com/login?return_to=%2Fvikibytes%2Fwtfpython |
|
WTFPL license
| https://github.com/vikibytes/wtfpython/blob/master/LICENSE |
|
0
stars
| https://github.com/vikibytes/wtfpython/stargazers |
|
2.7k
forks
| https://github.com/vikibytes/wtfpython/forks |
|
Branches
| https://github.com/vikibytes/wtfpython/branches |
|
Tags
| https://github.com/vikibytes/wtfpython/tags |
|
Activity
| https://github.com/vikibytes/wtfpython/activity |
|
Star
| https://github.com/login?return_to=%2Fvikibytes%2Fwtfpython |
|
Notifications
| https://github.com/login?return_to=%2Fvikibytes%2Fwtfpython |
|
Code
| https://github.com/vikibytes/wtfpython |
|
Pull requests
0
| https://github.com/vikibytes/wtfpython/pulls |
|
Actions
| https://github.com/vikibytes/wtfpython/actions |
|
Projects
0
| https://github.com/vikibytes/wtfpython/projects |
|
Security
Uh oh!
There was an error while loading. Please reload this page.
| https://github.com/vikibytes/wtfpython/security |
| Please reload this page | https://github.com/vikibytes/wtfpython |
|
Insights
| https://github.com/vikibytes/wtfpython/pulse |
|
Code
| https://github.com/vikibytes/wtfpython |
|
Pull requests
| https://github.com/vikibytes/wtfpython/pulls |
|
Actions
| https://github.com/vikibytes/wtfpython/actions |
|
Projects
| https://github.com/vikibytes/wtfpython/projects |
|
Security
| https://github.com/vikibytes/wtfpython/security |
|
Insights
| https://github.com/vikibytes/wtfpython/pulse |
| Branches | https://github.com/vikibytes/wtfpython/branches |
| Tags | https://github.com/vikibytes/wtfpython/tags |
| https://github.com/vikibytes/wtfpython/branches |
| https://github.com/vikibytes/wtfpython/tags |
| 389 Commits | https://github.com/vikibytes/wtfpython/commits/master/ |
| https://github.com/vikibytes/wtfpython/commits/master/ |
| images | https://github.com/vikibytes/wtfpython/tree/master/images |
| images | https://github.com/vikibytes/wtfpython/tree/master/images |
| irrelevant | https://github.com/vikibytes/wtfpython/tree/master/irrelevant |
| irrelevant | https://github.com/vikibytes/wtfpython/tree/master/irrelevant |
| wtfpython-pypi | https://github.com/vikibytes/wtfpython/tree/master/wtfpython-pypi |
| wtfpython-pypi | https://github.com/vikibytes/wtfpython/tree/master/wtfpython-pypi |
| .gitattributes | https://github.com/vikibytes/wtfpython/blob/master/.gitattributes |
| .gitattributes | https://github.com/vikibytes/wtfpython/blob/master/.gitattributes |
| .gitignore | https://github.com/vikibytes/wtfpython/blob/master/.gitignore |
| .gitignore | https://github.com/vikibytes/wtfpython/blob/master/.gitignore |
| .travis.yml | https://github.com/vikibytes/wtfpython/blob/master/.travis.yml |
| .travis.yml | https://github.com/vikibytes/wtfpython/blob/master/.travis.yml |
| CONTRIBUTING.md | https://github.com/vikibytes/wtfpython/blob/master/CONTRIBUTING.md |
| CONTRIBUTING.md | https://github.com/vikibytes/wtfpython/blob/master/CONTRIBUTING.md |
| CONTRIBUTORS.md | https://github.com/vikibytes/wtfpython/blob/master/CONTRIBUTORS.md |
| CONTRIBUTORS.md | https://github.com/vikibytes/wtfpython/blob/master/CONTRIBUTORS.md |
| LICENSE | https://github.com/vikibytes/wtfpython/blob/master/LICENSE |
| LICENSE | https://github.com/vikibytes/wtfpython/blob/master/LICENSE |
| README.md | https://github.com/vikibytes/wtfpython/blob/master/README.md |
| README.md | https://github.com/vikibytes/wtfpython/blob/master/README.md |
| code-of-conduct.md | https://github.com/vikibytes/wtfpython/blob/master/code-of-conduct.md |
| code-of-conduct.md | https://github.com/vikibytes/wtfpython/blob/master/code-of-conduct.md |
| mixed_tabs_and_spaces.py | https://github.com/vikibytes/wtfpython/blob/master/mixed_tabs_and_spaces.py |
| mixed_tabs_and_spaces.py | https://github.com/vikibytes/wtfpython/blob/master/mixed_tabs_and_spaces.py |
| README | https://github.com/vikibytes/wtfpython |
| Code of conduct | https://github.com/vikibytes/wtfpython |
| Contributing | https://github.com/vikibytes/wtfpython |
| WTFPL license | https://github.com/vikibytes/wtfpython |
| https://github.com/vikibytes/wtfpython/blob/master/images/logo.png |
| https://github.com/vikibytes/wtfpython#what-the-fck-python- |
| Chinese 中文 | https://github.com/leisurelicht/wtfpython-cn |
| Add translation | https://github.com/satwikkansal/wtfpython/issues/new?title=Add%20translation%20for%20%5BLANGUAGE%5D&body=Expected%20time%20to%20finish:%20%5BX%5D%20weeks.%20I%27ll%20start%20working%20on%20it%20from%20%5BY%5D. |
| Interactive | https://colab.research.google.com/github/satwikkansal/wtfpython/blob/master/irrelevant/wtf.ipynb |
| CLI | https://pypi.python.org/pypi/wtfpython |
| here | https://github.com/satwikkansal/wtfpython/releases/ |
| https://github.com/vikibytes/wtfpython#table-of-contents |
| Structure of the Examples | https://github.com/vikibytes/wtfpython#structure-of-the-examples |
| ▶ Some fancy Title | https://github.com/vikibytes/wtfpython#-some-fancy-title |
| Usage | https://github.com/vikibytes/wtfpython#usage |
| 👀 Examples | https://github.com/vikibytes/wtfpython#-examples |
| Section: Strain your brain! | https://github.com/vikibytes/wtfpython#section-strain-your-brain |
| ▶ First things first! * | https://github.com/vikibytes/wtfpython#-first-things-first- |
| ▶ Strings can be tricky sometimes | https://github.com/vikibytes/wtfpython#-strings-can-be-tricky-sometimes |
| ▶ Hash brownies | https://github.com/vikibytes/wtfpython#-hash-brownies |
| ▶ Deep down, we're all the same. | https://github.com/vikibytes/wtfpython#-deep-down-were-all-the-same |
| ▶ Disorder within order * | https://github.com/vikibytes/wtfpython#-disorder-within-order- |
| ▶ Keep trying... * | https://github.com/vikibytes/wtfpython#-keep-trying- |
| ▶ For what? | https://github.com/vikibytes/wtfpython#-for-what |
| ▶ Evaluation time discrepancy | https://github.com/vikibytes/wtfpython#-evaluation-time-discrepancy |
| ▶ How not to use is operator | https://github.com/vikibytes/wtfpython#-how-not-to-use-is-operator |
| ▶ is not ... is not is (not ...) | https://github.com/vikibytes/wtfpython#-is-not--is-not-is-not- |
| ▶ A tic-tac-toe where X wins in the first attempt! | https://github.com/vikibytes/wtfpython#-a-tic-tac-toe-where-x-wins-in-the-first-attempt |
| ▶ The sticky output function | https://github.com/vikibytes/wtfpython#-the-sticky-output-function |
| ▶ The chicken-egg problem * | https://github.com/vikibytes/wtfpython#-the-chicken-egg-problem- |
| ▶ Subclass relationships | https://github.com/vikibytes/wtfpython#-subclass-relationships |
| ▶ All-true-ation * | https://github.com/vikibytes/wtfpython#-all-true-ation- |
| ▶ The surprising comma | https://github.com/vikibytes/wtfpython#-the-surprising-comma |
| ▶ Strings and the backslashes | https://github.com/vikibytes/wtfpython#-strings-and-the-backslashes |
| ▶ not knot! | https://github.com/vikibytes/wtfpython#-not-knot |
| ▶ Half triple-quoted strings | https://github.com/vikibytes/wtfpython#-half-triple-quoted-strings |
| ▶ What's wrong with booleans? | https://github.com/vikibytes/wtfpython#-whats-wrong-with-booleans |
| ▶ Class attributes and instance attributes | https://github.com/vikibytes/wtfpython#-class-attributes-and-instance-attributes |
| ▶ Non-reflexive class method * | https://github.com/vikibytes/wtfpython#-non-reflexive-class-method- |
| ▶ yielding None | https://github.com/vikibytes/wtfpython#-yielding-none |
| ▶ Yielding from... return! * | https://github.com/vikibytes/wtfpython#-yielding-from-return- |
| ▶ Nan-reflexivity * | https://github.com/vikibytes/wtfpython#-nan-reflexivity- |
| ▶ Mutating the immutable! | https://github.com/vikibytes/wtfpython#-mutating-the-immutable |
| ▶ The disappearing variable from outer scope | https://github.com/vikibytes/wtfpython#-the-disappearing-variable-from-outer-scope |
| ▶ The mysterious key type conversion | https://github.com/vikibytes/wtfpython#-the-mysterious-key-type-conversion |
| ▶ Let's see if you can guess this? | https://github.com/vikibytes/wtfpython#-lets-see-if-you-can-guess-this |
| Section: Slippery Slopes | https://github.com/vikibytes/wtfpython#section-slippery-slopes |
| ▶ Modifying a dictionary while iterating over it | https://github.com/vikibytes/wtfpython#-modifying-a-dictionary-while-iterating-over-it |
| ▶ Stubborn del operation | https://github.com/vikibytes/wtfpython#-stubborn-del-operation |
| ▶ The out of scope variable | https://github.com/vikibytes/wtfpython#-the-out-of-scope-variable |
| ▶ Deleting a list item while iterating | https://github.com/vikibytes/wtfpython#-deleting-a-list-item-while-iterating |
| ▶ Lossy zip of iterators * | https://github.com/vikibytes/wtfpython#-lossy-zip-of-iterators- |
| ▶ Loop variables leaking out! | https://github.com/vikibytes/wtfpython#-loop-variables-leaking-out |
| ▶ Beware of default mutable arguments! | https://github.com/vikibytes/wtfpython#-beware-of-default-mutable-arguments |
| ▶ Catching the Exceptions | https://github.com/vikibytes/wtfpython#-catching-the-exceptions |
| ▶ Same operands, different story! | https://github.com/vikibytes/wtfpython#-same-operands-different-story |
| ▶ Be careful with chained operations | https://github.com/vikibytes/wtfpython#-be-careful-with-chained-operations |
| ▶ Name resolution ignoring class scope | https://github.com/vikibytes/wtfpython#-name-resolution-ignoring-class-scope |
| ▶ Needles in a Haystack * | https://github.com/vikibytes/wtfpython#-needles-in-a-haystack- |
| ▶ Splitsies * | https://github.com/vikibytes/wtfpython#-splitsies- |
| ▶ Wild imports * | https://github.com/vikibytes/wtfpython#-wild-imports- |
| ▶ All sorted? * | https://github.com/vikibytes/wtfpython#-all-sorted- |
| ▶ Midnight time doesn't exist? | https://github.com/vikibytes/wtfpython#-midnight-time-doesnt-exist |
| Section: The Hidden treasures! | https://github.com/vikibytes/wtfpython#section-the-hidden-treasures |
| ▶ Okay Python, Can you make me fly? | https://github.com/vikibytes/wtfpython#-okay-python-can-you-make-me-fly |
| ▶ goto, but why? | https://github.com/vikibytes/wtfpython#-goto-but-why |
| ▶ Brace yourself! | https://github.com/vikibytes/wtfpython#-brace-yourself |
| ▶ Let's meet Friendly Language Uncle For Life | https://github.com/vikibytes/wtfpython#-lets-meet-friendly-language-uncle-for-life |
| ▶ Even Python understands that love is complicated | https://github.com/vikibytes/wtfpython#-even-python-understands-that-love-is-complicated |
| ▶ Yes, it exists! | https://github.com/vikibytes/wtfpython#-yes-it-exists |
| ▶ Ellipsis * | https://github.com/vikibytes/wtfpython#-ellipsis- |
| ▶ Inpinity | https://github.com/vikibytes/wtfpython#-inpinity |
| ▶ Let's mangle | https://github.com/vikibytes/wtfpython#-lets-mangle |
| Section: Appearances are deceptive! | https://github.com/vikibytes/wtfpython#section-appearances-are-deceptive |
| ▶ Skipping lines? | https://github.com/vikibytes/wtfpython#-skipping-lines |
| ▶ Teleportation | https://github.com/vikibytes/wtfpython#-teleportation |
| ▶ Well, something is fishy... | https://github.com/vikibytes/wtfpython#-well-something-is-fishy |
| Section: Miscellaneous | https://github.com/vikibytes/wtfpython#section-miscellaneous |
| ▶ += is faster | https://github.com/vikibytes/wtfpython#--is-faster |
| ▶ Let's make a giant string! | https://github.com/vikibytes/wtfpython#-lets-make-a-giant-string |
| ▶ Minor Ones * | https://github.com/vikibytes/wtfpython#-minor-ones- |
| Contributing | https://github.com/vikibytes/wtfpython#contributing |
| Acknowledgements | https://github.com/vikibytes/wtfpython#acknowledgements |
| 🎓 License | https://github.com/vikibytes/wtfpython#-license |
| Surprise your friends as well! | https://github.com/vikibytes/wtfpython#surprise-your-friends-as-well |
| More content like this? | https://github.com/vikibytes/wtfpython#more-content-like-this |
| https://github.com/vikibytes/wtfpython#structure-of-the-examples |
| https://github.com/vikibytes/wtfpython#-some-fancy-title |
| https://github.com/vikibytes/wtfpython#-explanation |
| https://github.com/vikibytes/wtfpython#usage |
| here | https://github.com/satwikkansal/wtfPython |
| pypi package | https://pypi.python.org/pypi/wtfpython |
| https://github.com/vikibytes/wtfpython#-examples |
| https://github.com/vikibytes/wtfpython#section-strain-your-brain |
| https://github.com/vikibytes/wtfpython#-first-things-first- |
| https://github.com/vikibytes/wtfpython#-explanation-1 |
| https://github.com/vikibytes/wtfpython#-strings-can-be-tricky-sometimes |
| https://github.com/vikibytes/wtfpython#-explanation-2 |
| here | https://github.com/python/cpython/blob/3.6/Objects/codeobject.c#L19 |
| https://github.com/vikibytes/wtfpython/blob/master/images/string-intern/string_intern.png |
| issue | https://github.com/satwikkansal/wtfpython/issues/100 |
| peephole optimization | https://en.wikipedia.org/wiki/Peephole_optimization |
| Here's | https://github.com/python/cpython/blob/3.6/Python/peephole.c#L288 |
| here | https://bugs.python.org/issue11549 |
| https://github.com/vikibytes/wtfpython#-hash-brownies |
| https://github.com/vikibytes/wtfpython#-explanation-3 |
| hash collision | https://en.wikipedia.org/wiki/Collision_(computer_science) |
| answer | https://stackoverflow.com/a/32211042/4354153 |
| https://github.com/vikibytes/wtfpython#-deep-down-were-all-the-same |
| https://github.com/vikibytes/wtfpython#-explanation-4 |
| https://github.com/vikibytes/wtfpython#-disorder-within-order- |
| https://github.com/vikibytes/wtfpython#-explanation-5 |
| docs | https://docs.python.org/3/library/collections.html#ordereddict-objects |
| https://github.com/vikibytes/wtfpython#-keep-trying- |
| https://github.com/vikibytes/wtfpython#-explanation-6 |
| https://github.com/vikibytes/wtfpython#-for-what |
| https://github.com/vikibytes/wtfpython#-explanation-7 |
| Python grammar | https://docs.python.org/3/reference/grammar.html |
| https://github.com/vikibytes/wtfpython#-evaluation-time-discrepancy |
| https://github.com/vikibytes/wtfpython#-explanation-8 |
| generator | https://wiki.python.org/moin/Generators |
| PEP-289 | https://www.python.org/dev/peps/pep-0289/#the-details |
| https://github.com/vikibytes/wtfpython#-how-not-to-use-is-operator |
| https://github.com/vikibytes/wtfpython#-explanation-9 |
| https://docs.python.org/3/c-api/long.html | https://docs.python.org/3/c-api/long.html |
| issue | https://github.com/satwikkansal/wtfpython/issues/100 |
| https://github.com/vikibytes/wtfpython#-is-not--is-not-is-not- |
| https://github.com/vikibytes/wtfpython#-explanation-10 |
| https://github.com/vikibytes/wtfpython#-a-tic-tac-toe-where-x-wins-in-the-first-attempt |
| https://github.com/vikibytes/wtfpython#-explanation-11 |
| https://github.com/vikibytes/wtfpython/blob/master/images/tic-tac-toe/after_row_initialized.png |
| https://github.com/vikibytes/wtfpython/blob/master/images/tic-tac-toe/after_board_initialized.png |
| this | https://github.com/satwikkansal/wtfpython/issues/68 |
| https://github.com/vikibytes/wtfpython#-the-sticky-output-function |
| https://github.com/vikibytes/wtfpython#-explanation-12 |
| https://github.com/vikibytes/wtfpython#-the-chicken-egg-problem- |
| https://github.com/vikibytes/wtfpython#-explanation-13 |
| metaclass | https://realpython.com/python-metaclasses/ |
| https://github.com/vikibytes/wtfpython#-subclass-relationships |
| https://github.com/vikibytes/wtfpython#-explanation-14 |
| here | https://www.naftaliharris.com/blog/python-subclass-intransitivity/ |
| https://github.com/vikibytes/wtfpython#-all-true-ation- |
| https://github.com/vikibytes/wtfpython#-explanation-15 |
| https://github.com/vikibytes/wtfpython#-the-surprising-comma |
| https://github.com/vikibytes/wtfpython#-explanation-16 |
| fixed in Python 3.6 | https://bugs.python.org/issue9232 |
| this | https://bugs.python.org/issue9232#msg248399 |
| https://github.com/vikibytes/wtfpython#-strings-and-the-backslashes |
| https://github.com/vikibytes/wtfpython#-explanation-17 |
| https://github.com/vikibytes/wtfpython#-not-knot |
| https://github.com/vikibytes/wtfpython#-explanation-18 |
| https://github.com/vikibytes/wtfpython#-half-triple-quoted-strings |
| https://github.com/vikibytes/wtfpython#-explanation-19 |
| string literal concatenation | https://docs.python.org/2/reference/lexical_analysis.html#string-literal-concatenation |
| https://github.com/vikibytes/wtfpython#-whats-wrong-with-booleans |
| https://github.com/vikibytes/wtfpython#-explanation-20 |
| answer | https://stackoverflow.com/a/8169049/4354153 |
| https://github.com/vikibytes/wtfpython#-class-attributes-and-instance-attributes |
| https://github.com/vikibytes/wtfpython#-explanation-21 |
| https://github.com/vikibytes/wtfpython#-non-reflexive-class-method- |
| https://github.com/vikibytes/wtfpython#-explanation-22 |
| https://github.com/vikibytes/wtfpython#-yielding-none |
| https://github.com/vikibytes/wtfpython#-explanation-23 |
| https://stackoverflow.com/questions/32139885/yield-in-list-comprehensions-and-generator-expressions | https://stackoverflow.com/questions/32139885/yield-in-list-comprehensions-and-generator-expressions |
| http://bugs.python.org/issue10544 | http://bugs.python.org/issue10544 |
| https://github.com/vikibytes/wtfpython#-yielding-from-return- |
| https://github.com/vikibytes/wtfpython#-explanation-24 |
| PEP380 | https://www.python.org/dev/peps/pep-0380/ |
| official docs | https://www.python.org/dev/peps/pep-0380/#enhancements-to-stopiteration |
| https://github.com/vikibytes/wtfpython#-nan-reflexivity- |
| https://github.com/vikibytes/wtfpython#-explanation-25 |
| Reflexivity, and other pillars of civilization | https://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/ |
| https://github.com/vikibytes/wtfpython#-mutating-the-immutable |
| https://github.com/vikibytes/wtfpython#-explanation-26 |
| https://docs.python.org/2/reference/datamodel.html | https://docs.python.org/2/reference/datamodel.html |
| https://github.com/vikibytes/wtfpython#-the-disappearing-variable-from-outer-scope |
| https://github.com/vikibytes/wtfpython#-explanation-27 |
| https://docs.python.org/3/reference/compound_stmts.html#except | https://docs.python.org/3/reference/compound_stmts.html#except |
| https://github.com/vikibytes/wtfpython#-the-mysterious-key-type-conversion |
| https://github.com/vikibytes/wtfpython#-explanation-28 |
| https://github.com/vikibytes/wtfpython#-lets-see-if-you-can-guess-this |
| https://github.com/vikibytes/wtfpython#-explanation-29 |
| Python language reference | https://docs.python.org/2/reference/simple_stmts.html#assignment-statements |
| https://github.com/vikibytes/wtfpython#section-slippery-slopes |
| https://github.com/vikibytes/wtfpython#-modifying-a-dictionary-while-iterating-over-it |
| https://github.com/vikibytes/wtfpython#-explanation-30 |
| here | https://github.com/satwikkansal/wtfpython/issues/53 |
| this | https://stackoverflow.com/questions/44763802/bug-in-python-dict |
| https://github.com/vikibytes/wtfpython#-stubborn-del-operation |
| https://github.com/vikibytes/wtfpython#-explanation-31 |
| https://github.com/vikibytes/wtfpython#-the-out-of-scope-variable |
| https://github.com/vikibytes/wtfpython#-explanation-32 |
| this | http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html |
| https://github.com/vikibytes/wtfpython#-deleting-a-list-item-while-iterating |
| https://github.com/vikibytes/wtfpython#-explanation-33 |
| thread | https://stackoverflow.com/questions/45946228/what-happens-when-you-try-to-delete-a-list-element-while-iterating-over-it |
| thread | https://stackoverflow.com/questions/45877614/how-to-change-all-the-dictionary-keys-in-a-for-loop-with-d-items |
| https://github.com/vikibytes/wtfpython#-lossy-zip-of-iterators- |
| https://github.com/vikibytes/wtfpython#-explanation-34 |
| docs | https://docs.python.org/3.3/library/functions.html#zip |
| https://github.com/vikibytes/wtfpython#-loop-variables-leaking-out |
| https://github.com/vikibytes/wtfpython#-explanation-35 |
| What’s New In Python 3.0 | https://docs.python.org/3/whatsnew/3.0.html |
| https://github.com/vikibytes/wtfpython#-beware-of-default-mutable-arguments |
| https://github.com/vikibytes/wtfpython#-explanation-36 |
| https://github.com/vikibytes/wtfpython#-catching-the-exceptions |
| https://github.com/vikibytes/wtfpython#-explanation-37 |
| https://github.com/vikibytes/wtfpython#-same-operands-different-story |
| https://github.com/vikibytes/wtfpython#-explanation-38 |
| https://github.com/vikibytes/wtfpython#-be-careful-with-chained-operations |
| https://github.com/vikibytes/wtfpython#-explanation-39 |
| https://docs.python.org/2/reference/expressions.html#not-in | https://docs.python.org/2/reference/expressions.html#not-in |
| https://github.com/vikibytes/wtfpython#-name-resolution-ignoring-class-scope |
| https://github.com/vikibytes/wtfpython#-explanation-40 |
| https://github.com/vikibytes/wtfpython#-needles-in-a-haystack- |
| https://github.com/vikibytes/wtfpython#-explanation-41 |
| here | http://docs.python.org/2/faq/design.html#why-doesn-t-list-sort-return-the-sorted-list |
| https://github.com/vikibytes/wtfpython#-splitsies- |
| https://github.com/vikibytes/wtfpython#-explanation-42 |
| docs | https://docs.python.org/2.7/library/stdtypes.html#str.split |
| https://github.com/vikibytes/wtfpython#-wild-imports- |
| https://github.com/vikibytes/wtfpython#-explanation-43 |
| https://github.com/vikibytes/wtfpython#-all-sorted- |
| https://github.com/vikibytes/wtfpython#-explanation-44 |
| https://github.com/vikibytes/wtfpython#-midnight-time-doesnt-exist |
| https://github.com/vikibytes/wtfpython#-explanation-45 |
| https://github.com/vikibytes/wtfpython#section-the-hidden-treasures |
| https://github.com/vikibytes/wtfpython#-okay-python-can-you-make-me-fly |
| https://github.com/vikibytes/wtfpython#-explanation-46 |
| classic XKCD comic | http://xkcd.com/353/ |
| code | https://github.com/python/cpython/blob/master/Lib/antigravity.py#L7-L17 |
| XKCD's geohashing algorithm | https://xkcd.com/426/ |
| https://github.com/vikibytes/wtfpython#-goto-but-why |
| https://github.com/vikibytes/wtfpython#-explanation-47 |
| announced | https://mail.python.org/pipermail/python-announce-list/2004-April/002982.html |
| reason | https://docs.python.org/3/faq/design.html#why-is-there-no-goto |
| https://github.com/vikibytes/wtfpython#-brace-yourself |
| code | https://github.com/python/cpython/blob/master/Lib/__future__.py |
| https://github.com/vikibytes/wtfpython#-explanation-48 |
| here | https://github.com/python/cpython/blob/025eb98dc0c1dc27404df6c544fc2944e0fa9f3a/Python/future.c#L49 |
| future statement | https://docs.python.org/3.3/reference/simple_stmts.html#future-statements |
| https://github.com/vikibytes/wtfpython#-lets-meet-friendly-language-uncle-for-life |
| https://github.com/vikibytes/wtfpython#-explanation-49 |
| PEP-401 | https://www.python.org/dev/peps/pep-0401/ |
| here | https://www.python.org/dev/peps/pep-0401/ |
| issue | https://github.com/satwikkansal/wtfpython/issues/94 |
| https://github.com/vikibytes/wtfpython#-even-python-understands-that-love-is-complicated |
| https://github.com/vikibytes/wtfpython#-explanation-50 |
| PEP 20 | https://www.python.org/dev/peps/pep-0020 |
| this.py | https://hg.python.org/cpython/file/c3896275c0f6/Lib/this.py |
| https://github.com/vikibytes/wtfpython#-yes-it-exists |
| https://github.com/vikibytes/wtfpython#-explanation-51 |
| https://github.com/vikibytes/wtfpython#-ellipsis- |
| https://github.com/vikibytes/wtfpython#-explanation-52 |
| type hinting | https://docs.python.org/3/library/typing.html |
| https://github.com/vikibytes/wtfpython#-inpinity |
| https://github.com/vikibytes/wtfpython#-explanation-53 |
| https://github.com/vikibytes/wtfpython#-lets-mangle |
| https://github.com/vikibytes/wtfpython#-explanation-54 |
| Name Mangling | https://en.wikipedia.org/wiki/Name_mangling |
| https://github.com/vikibytes/wtfpython#section-appearances-are-deceptive |
| https://github.com/vikibytes/wtfpython#-skipping-lines |
| https://github.com/vikibytes/wtfpython#-explanation-55 |
| code point | https://en.wikipedia.org/wiki/Code_point |
| https://github.com/vikibytes/wtfpython#-teleportation |
| https://github.com/vikibytes/wtfpython#-explanation-56 |
| https://github.com/vikibytes/wtfpython#-well-something-is-fishy |
| mixed_tabs_and_spaces.py | https://github.com/vikibytes/wtfpython/blob/master/mixed_tabs_and_spaces.py |
| https://github.com/vikibytes/wtfpython#-explanation-57 |
| https://github.com/vikibytes/wtfpython#section-miscellaneous |
| https://github.com/vikibytes/wtfpython#--is-faster |
| https://github.com/vikibytes/wtfpython#-explanation-58 |
| https://github.com/vikibytes/wtfpython#-lets-make-a-giant-string |
| https://github.com/vikibytes/wtfpython#-explanation-59 |
| timeit | https://docs.python.org/3/library/timeit.html |
| %timeit | https://ipython.org/ipython-doc/dev/interactive/magics.html#magic-timeit |
| Zen of Python | https://www.python.org/dev/peps/pep-0020/ |
| https://github.com/vikibytes/wtfpython#-minor-ones- |
| sequences | https://docs.python.org/3/glossary.html#term-sequence |
| thread | https://stackoverflow.com/questions/3654830/why-are-there-no-and-operators-in-python |
| Raymond Hettinger's tweet | https://twitter.com/raymondh/status/1131103570856632321?lang=en |
| converse implication | https://en.wikipedia.org/wiki/Converse_implication |
| Source | https://github.com/cosmologicon/pywat/blob/master/explanation.md#the-undocumented-converse-implication-operator |
| Global Interpreter Lock | https://wiki.python.org/moin/GlobalInterpreterLock |
| multiprocessing | https://docs.python.org/2/library/multiprocessing.html |
| interesting story | http://chris.improbable.org/2014/8/25/adventures-in-unicode-digits/ |
| https://github.com/vikibytes/wtfpython#contributing |
| issues labeled translation | https://github.com/satwikkansal/wtfpython/issues?q=is%3Aissue+is%3Aopen+label%3Atranslation |
| CONTRIBUTING.md | https://github.com/vikibytes/wtfpython/blob/master/CONTRIBUTING.md |
| issue | https://github.com/satwikkansal/wtfpython/issues/new |
| https://github.com/vikibytes/wtfpython#acknowledgements |
| wtfjs | https://github.com/denysdovhan/wtfjs |
| https://github.com/vikibytes/wtfpython#some-nice-links |
| https://www.youtube.com/watch?v=sH4XF6pKKmk | https://www.youtube.com/watch?v=sH4XF6pKKmk |
| https://www.reddit.com/r/Python/comments/3cu6ej/what_are_some_wtf_things_about_python | https://www.reddit.com/r/Python/comments/3cu6ej/what_are_some_wtf_things_about_python |
| https://sopython.com/wiki/Common_Gotchas_In_Python | https://sopython.com/wiki/Common_Gotchas_In_Python |
| https://stackoverflow.com/questions/530530/python-2-x-gotchas-and-landmines | https://stackoverflow.com/questions/530530/python-2-x-gotchas-and-landmines |
| https://stackoverflow.com/questions/1011431/common-pitfalls-in-python | https://stackoverflow.com/questions/1011431/common-pitfalls-in-python |
| https://www.python.org/doc/humor/ | https://www.python.org/doc/humor/ |
| https://github.com/cosmologicon/pywat#the-undocumented-converse-implication-operator | https://github.com/cosmologicon/pywat#the-undocumented-converse-implication-operator |
| https://www.codementor.io/satwikkansal/python-practices-for-efficient-code-performance-memory-and-usability-aze6oiq65 | https://www.codementor.io/satwikkansal/python-practices-for-efficient-code-performance-memory-and-usability-aze6oiq65 |
| https://github.com/wemake-services/wemake-python-styleguide/search?q=wtfpython&type=Issues | https://github.com/wemake-services/wemake-python-styleguide/search?q=wtfpython&type=Issues |
| Hacker News | https://news.ycombinator.com/item?id=21862073 |
| Reddit | https://www.reddit.com/r/programming/comments/edsh3q/what_the_fck_python_30_exploring_and/ |
| https://github.com/vikibytes/wtfpython#-license |
| http://www.wtfpl.net |
| Satwik Kansal | https://satwikkansal.xyz |
| https://github.com/vikibytes/wtfpython#surprise-your-friends-as-well |
| Twitter | https://twitter.com/intent/tweet?url=https://github.com/satwikkansal/wtfpython&text=If%20you%20really%20think%20you%20know%20Python,%20think%20once%20more!%20Check%20out%20wtfpython&hashtags=python,wtfpython |
| Linkedin | https://www.linkedin.com/shareArticle?url=https://github.com/satwikkansal&title=What%20the%20f*ck%20Python!&summary=If%20you%20really%20thing%20you%20know%20Python,%20think%20once%20more! |
| Facebook | https://www.facebook.com/dialog/share?app_id=536779657179021&display=page&href=https%3A%2F%2Fgithub.com%2Fsatwikkansal%2Fwtfpython"e=If%20you%20really%20think%20you%20know%20Python%2C%20think%20once%20more! |
| https://github.com/vikibytes/wtfpython#need-a-pdf-version |
| here | https://satwikkansal.xyz/wtfpython-pdf/ |
| here | https://www.satwikkansal.xyz/content-like-wtfpython/ |
| plant a tree | https://teamtrees.org/ |
|
Readme
| https://github.com/vikibytes/wtfpython#readme-ov-file |
|
WTFPL license
| https://github.com/vikibytes/wtfpython#WTFPL-1-ov-file |
|
Code of conduct
| https://github.com/vikibytes/wtfpython#coc-ov-file |
|
Contributing
| https://github.com/vikibytes/wtfpython#contributing-ov-file |
| Please reload this page | https://github.com/vikibytes/wtfpython |
|
Activity | https://github.com/vikibytes/wtfpython/activity |
|
0
stars | https://github.com/vikibytes/wtfpython/stargazers |
|
0
watching | https://github.com/vikibytes/wtfpython/watchers |
|
0
forks | https://github.com/vikibytes/wtfpython/forks |
|
Report repository
| https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fvikibytes%2Fwtfpython&report=vikibytes+%28user%29 |
| Releases | https://github.com/vikibytes/wtfpython/releases |
|
2
tags
| https://github.com/vikibytes/wtfpython/tags |
| Packages
0 | https://github.com/users/vikibytes/packages?repo_name=wtfpython |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |