3 ms·
Hi! This is part 6 of my Python behind the scenes series. Each part of the series covers how some aspect of the language is implemented in the interpreter, CPyt
by r4victor 6y ago
Hi! This is part 6 of my Python behind the scenes series. Each part of the series covers how some aspect of the language is implemented in the interpreter, CPython. This time we'll focus on the Python object system. You'll learn:
- What Python objects and types are and how they are implemented.
- What slots are and how they determine the behavior of objects.
- How slots are related to special methods.
I'd be glad to get your feedback and answer your questions. Thanks!
- ryan-duve 6y agoI have a C background from graduate school and a Python background from my professional work, but I've never explored how Python is implemented in C until I came across one of your previous parts of this series. I don't have any questions. I just wanted to let you know I think you do a fantastic job writing these up. The thinking process is very clear, and the resource links are well placed for followup research. High quality stuff, for sure. Thanks for making these. I look forward to future installations.
- r4victor 6y agoThanks, Ryan! The series is going on. Stay tuned!
- azhenley 6y agoAwesome, thanks for this! In the spring I’ll be teaching a graduate-level university course on how the Python compiler and tooling works, so I’ll be showing them your articles.
- stonecharioteer 6y agoYou should give a go at reading or recommending Anthony Shaw's excellent book[1] (or at the very least the free article on Real Python[2]). 1. https://realpython.com/products/cpython-internals-book/ https://realpython.com/products/cpython-internals-book/ 2. https://realpython.com/cpython-source-code-guide/ https://realpython.com/cpython-source-code-guide/
- lsferreira42 6y agoCan i translate this series in Portuguese? I think that would help a lot of coders that i know, but they can't read english.
- tcbawo 6y agoOff topic, but do the programmers you know that can't read English struggle using programming languages and libraries where the keywords, class, variable, and function names are primarily in English? I'm curious how beginning or ESL programmers manage. Are there ecospheres where they can manage using only their first languages?
- dontTango 6y agoVariables and nouns are easy to translate. Sentence meaning is significantly harder.
- 411111111111111 6y agoThere is a vast difference between people that don't fluidly read/speak English and people that can't be arsed to learn what the 20 English keywords mean a programming language might use.
- swirepe 6y ago20 keywords, but what about EscapeString, or SpringContextIntegrationTest? A program can use a lot of English words.
- 411111111111111 6y agoHow does a cord for fleeing tell you anything about what it actually is? Both of your examples bring very little meaning from their English definition. You just know a second definition in the context of programming, which is why you can deduce what it does. The same applies to the people that don't fluidly speak the language.
- brodouevencode 6y agoThis is a great series. Thank you for this.
- fantod 6y agoThis is great! There aren't enough references on Python internals, I find. Not sure you're at all interested in going in this direction, but I (and likely many people) would be really interested in a similar explanation of NumPy internals.
- callamdelaney 6y agoThere are some great videos on youtube, a little outdated but gold if you can find them. It's this guy who literally sits at his desk for an hour and a half straight and walks a class line by line through various parts of cpython2.7 - little outdated but was awesome. There are multiple parts.
- mattip 6y agoPlease open a documentation issue at https://github.com/numpy/numpy/issues https://github.com/numpy/numpy/issues describing exactly which internals you would like to see explained: indexing, ufuncs, linkage, random, dtypes, ... and what format you would like to see the documentation in: text, video, lessons with questions/answers, ... As for python internals, https://snarky.ca/ https://snarky.ca/ has some great short high level “how does this construct work” text explainations.
- edgyquant 6y agoMore people are looking for passive articles to consume than filing a bug report to request information on specific systems. This reply is unnecessary.