Exploring our Python Interpreter

Video thumbnail (Frame 0) Video thumbnail (Frame 1037) Video thumbnail (Frame 1862) Video thumbnail (Frame 2975) Video thumbnail (Frame 3877) Video thumbnail (Frame 6332) Video thumbnail (Frame 7367) Video thumbnail (Frame 9494) Video thumbnail (Frame 10835) Video thumbnail (Frame 11587) Video thumbnail (Frame 12116) Video thumbnail (Frame 12897) Video thumbnail (Frame 13753) Video thumbnail (Frame 15529) Video thumbnail (Frame 17242) Video thumbnail (Frame 18191) Video thumbnail (Frame 18947) Video thumbnail (Frame 19765) Video thumbnail (Frame 20481) Video thumbnail (Frame 21196) Video thumbnail (Frame 22788) Video thumbnail (Frame 23487) Video thumbnail (Frame 24923) Video thumbnail (Frame 25946) Video thumbnail (Frame 26819) Video thumbnail (Frame 28378) Video thumbnail (Frame 30161) Video thumbnail (Frame 32474) Video thumbnail (Frame 33117) Video thumbnail (Frame 33793) Video thumbnail (Frame 35126) Video thumbnail (Frame 36583) Video thumbnail (Frame 37092)
Video in TIB AV-Portal: Exploring our Python Interpreter

Formal Metadata

Exploring our Python Interpreter
Title of Series
Part Number
Number of Parts
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this license.
Release Date

Content Metadata

Subject Area
Stephane Wirtel - Exploring our Python Interpreter During the last CPython sprints at PyCon US (Montreal), I started to contribute to the CPython project and I wanted to understand the beast. In this case, there is only one solution, trace the code from the beginning. From the command line to the interpreter, we will take part to an adventure. The idea behind is just to show how CPython works for a new contributor. ----- During my last CPython sprint, I started to contribute to the CPython code and I wanted to understand the beast. In this case, there is only one solution, trace the code from the beginning. From the command line to the interpreter, we will take part to an adventure * Overview of the structure of the project and the directories. * From the Py Main function to the interpreter. * The used technics for the Lexer, Parser and the generation of the AST and of course of the Bytecodes. * We will see some bytecodes with the dis module. * How does VM works, it's a stack machine. * The interpreter and its main loop of the Virtual Machine. The idea behind is just to show how CPython works for a new contributor to CPython. From the command line, we will learn that Python is a library and that we can embed it in a C project. In fact we will see the Py Main function to the ceval.c file of the interpreter. But there is no magic in the CPython code, we will travel in the lexer and the parser of CPython, and why not, by the AST for one Python expression. After the AST, we will visit the Compiler and the Bytecodes for the interpreter. Of course, we will learn there is the peepholer where some basic instructions are optimised by the this component. And of course, the interpreter, this virtual machine is really interesting for the newbiew, because it's a big stack where the bytecodes are executed one by one on the stack and the ceval.c file.
Inference Data mining Game controller Computer animation Interpreter (computing)
Group action Computer animation Natural number Projective plane Self-organization Right angle Student's t-test Event horizon
Computer animation Source code Expression Letterpress printing Statement (computer science) Pattern language Student's t-test Summierbarkeit
Laptop Point (geometry) Metropolitan area network Graph (mathematics) Divisor Witt algebra Software developer Source code Electronic program guide Letterpress printing Compiler Parameter (computer programming) Checklist Flow separation Theory Computer animation Right angle Software testing Data structure Traffic reporting Form (programming) Hydraulic jump Computing platform Reverse engineering
Point (geometry) Software bug Dependent and independent variables Email Link (knot theory) Information systems Electronic mailing list Internet service provider Core dump Online help Electronic mailing list Student's t-test Flow separation Open set Computer programming Value-added network Software bug Message passing Arithmetic mean Computer animation Semiconductor memory Interpreter (computing) Video game Condition number
Projective plane Source code Electronic mailing list Parameter (computer programming) Port scanner Software maintenance Sign (mathematics) Arithmetic mean Goodness of fit Loop (music) Computer animation Personal digital assistant Website
Dataflow Computer animation Software developer Code Software testing Density of states Statute
Finite element method Kernel (computing) Dataflow Computer animation Data mining Software testing Right angle Electronic mailing list Density of states
Message passing Stapeldatei Dataflow Human migration Computer animation Software developer Patch (Unix) Software testing Density of states Bit
Point (geometry) Stapeldatei Information Multiplication sign Source code Branch (computer science) Open set Directory service Computer programming Neuroinformatik Revision control Process (computing) Computer animation
Metropolitan area network Graph (mathematics) Multiplication sign Directory service Directory service Mereology Formal language Process (computing) Computer animation Formal grammar Endliche Modelltheorie Object (grammar) Library (computing)
Implementation Interior (topology) Directory service Grand Unified Theory Electronic mailing list Directory service Data dictionary Computer programming Higher-order logic Formal language Computer animation Software Object (grammar) Resultant Library (computing) Condition number
Computer animation Telecommunication Expert system Library (computing)
Computer animation Expression Table (information) Resultant
Metropolitan area network Word Computer animation Line (geometry) Interpreter (computing) Interpreter (computing) ACID Sequence Computer programming Compiler
Computer animation Software Personal digital assistant Software developer Line (geometry) Resultant Window Library (computing)
Parsing Multitier architecture Token ring Length Multiplication sign Cellular automaton Source code Expression Data storage device Type theory Computer animation Integrated development environment String (computer science) Program slicing Authorization
Metropolitan area network Parsing Functional (mathematics) Code Information systems Weight Expression Content (media) Number Computer animation Bit rate Personal digital assistant String (computer science) Endliche Modelltheorie Pressure Metropolitan area network
Parsing Computer animation Information Interpreter (computing) Software Code Maxima and minima Compiler Parameter (computer programming) Endliche Modelltheorie Mathematical optimization Compact space
Parsing Computer animation Interpreter (computing) Compiler Parameter (computer programming)
Parsing Virtual reality Computer animation Vector space Interpreter (computing) Virtual machine Compiler Right angle Stack (abstract data type) Physical system
Parsing Pointer (computer programming) Computer animation Divisor Personal digital assistant Information overload Term (mathematics) Source code Interpreter (computing) Compiler Mereology Physical system
Metropolitan area network Parsing Binary code Sound effect Compiler Grand Unified Theory Streaming media Mereology Arm Number Product (business) Population density Computer animation Semiconductor memory Robotics Forest Resultant Physical system
Functional (mathematics) Code Source code MIDI Maxima and minima Compiler Line (geometry) Evolute Theory Compiler Computer animation Different (Kate Ryan album) Function (mathematics) Endliche Modelltheorie Physical system Flag
Functional (mathematics) Computer animation Computer programming
Revision control Computer animation Patch (Unix) Source code Right angle
Point (geometry) Computer animation Internet forum Endliche Modelltheorie Metropolitan area network
Group action State of matter Different (Kate Ryan album) Compiler Cloning Summierbarkeit Mereology Formal language Condition number
and will you join me in welcoming all speakers that and you tell is talk about the Python interpreter if we I think I'm looking good controls because it was like just experience Ruby interpreter of the scaling so that the mining is just on the inference differently than the I from Belgium where we have some years and therefore them and by the fall of of course I'm a puddle over since the 1st of the the cabin on all the 3 of them and not to see if I can draw
that just that is just an introduction uh yes and just a small contributed to the by turning to nature if you know the project concurrent thereafter was about and nominated a member of the PSF buttons of definition of schools can become a member of the PSNR and since 2 or 3 years and a member of the group right in society the organizer of the event and the event this welcome
so just a reminder and just an introduction and not according OK just contributor if you want to compute just press some patch and and and so about the student the
student will be released simple we have all to start with the pattern not only can I price of can I write a print statement of just that OK just what can we read the source code try to understand we will have a small question of created was the result of of this expression to reduce then a small summary and so OK this that's a great
question questions or maybe we the but developers again like when you want to start to develop receive item that was my kids right in Montreal sometimes we can say find some sprints very uses prints on C by and that was my kids were working with my body and my laptop and are just asked to on the reverse so I would like to help users to write 1st thing so can you read that the developers guide
that guy's and you have course I can induce the command it's just a small the human story here is that during is just about is just the report again if you want to start to develop to cancer right and you can read use of this argumentation you will read how to make a a clue of the requisite theory onto the jump to for example you want to have a new keywords in the syntax of vitamin this a small checklist and factor of adjectives we 20 points to to refine OK does that mean that all to become but then again is the really interesting because we have some explanation about this structure in the of the bike and the reverse the past and you can read everything so between interesting because you getting started on to compile of can you help for example with the documentation of the source of all we've ever and 0 to write a test and I just want to run the test on several platforms OK so come back to the book my presentation so that the idea will explain decreased the graph grammars old traditions indexed and just the design of the bike and compiled yes we have the source code and by come there will the
links so the passage of the people of agenda by Canada and with severe conditions so we can find the recommendation of this the when you start with the and so we have a question of how can I have for you but for me but when you go in the printer have an issue and this issue of how can I fix it I don't want you can send a message to this life mailing list by until the vitamin terrorists interest is just a beginning IST program where you can send to a request you will get some response from given
respond working on that at the memory it so you know myself and of course the this really interesting because you can just get on boats the solution for you if you OK but in my kids I wanted to modify the interpreter of each the LexA becuase found and she's an and when I send my message my and my mail or receive a response from you where's Tony sorry that is fuckin and there's no 1 person to person for the syntax of so of course you want to start where it is that you have the meanings where the mailing lists we have down and so the bikes and and in fact when you create a new bugs and Aboutrika of white and you have a million years for that you can follow him just to Europe to receive no sorry some notification when you want to discuss about the value the other 1 meaning just many this is just not that with the protracted in with from the if you need some help you have the mentorship meaning and if you want to discuss about 1 of the points in the course of white and you have a million years the white and if you want to create if you have if you haven't assessed
and also might be for example the father Python project to try to improve the performance of white and uh you can try to submit something on the maintenance biotin and is minutes and you will see if you have good residents of Woodford but are not In this case the the today we these cues about the performance with us and carry on with UV loop rest if you're interested by the speed of light and you can discuss some new smelling that's really useful if it's a meaning where we discussed about the internal parts of in not about only to use the bed was the best practice for the performance so how to contribute 1st but reason but you go on the back boats that to fight her
website and you create a user account With this because argument you have to sign a contributor agreement with the PSF because Korea is that the whole narrative the source
code appears OK the influence of yes so to so the statute just alternate
prove to point 1st you have the documentation please we have a good documentation that we have a missing some missing tutorials for example a person can with the documentation of what as in but we we hope we don't have tutorial about that old can we start with US can
we use it and the rest we have a reference to the documentation if you want to contribute to the right the right yes cost you can create some issues to them and then that we should find a body of course
off if you want to feature in the feature of I'm going to want to show a future goal of small future um we need some reviewers yeah issues moved from south kernel of 1st we have we only
have 10 commits further supreme if you want to contribute just review the patches and then
we will be happy OK you receive a good message thank you because it's really interesting and important for us sometimes you can create a batch propose just create an issue proposed about and sometimes that's really interesting because if you have created your patch and you can wait for 6 months before our
interview because we have some Curatory original worse if you want to contribute this it's the latest and agreed yes of course of program the processes through so and I have some issues of open issues and hurricane so 2 years sometimes the 3 acute for for me because that's why might just not meant in the source code we don't have time for yeah the last point to just we try to meet it's by its own computer by material yes yes yes you can create account you can use rakendata but just create a pull request I prefer that used usually when you try to create a firstly you don't know the the the branch you create your batch and you created data this defined you will send it with you will uploaded to the protracted if there is a new version of year but just just of that so OK and so what can
we do just firstly when you start maybe we can try to find the data is of light and and try to understand them in fact but can we find information firstly we look documentation the Dr. directory just demand a of
y times where you will find this in fact uh the reference of the language the reference of the library is sometimes based on the library you can buy some books that in business duty amount the there are some good books the good preferences but the dialog to drum to adjust the grammar where a reminder ITER is just the text like those that if you want to modify and you have the grammatical directory in the parts of the because if you had a new keyword you have to let stand and just improve the graph of the process and history and like of course uh you have to leave directory just for the Python library of Python models for
example you have the talent and the TV you can look if you want to modify his is just in this directory for the mother's directory of C she part of light for the objects for example
you want to actually implementation of the dictionary of items can go in the objects and there OK of then we have the programs directory it just the executive and then because Python use a small executive and fight fight and it's a library you can go do library for if you want to and then results
in the widening software OK of of the conditions we have a reference for the language
from from the library the that the reference for the city here show won't rely on you can reduce the communication and I sincerely wish we want a small interfering with an expert across Ontario OK governance successfully just yet another
again no no no it's really boring because you have expressed in there
and then on through this thing on the on the table of neural tube the lunch and they tried to improve the documentation will something we you want to create 2 of the tutorial so I have 1 question just 1 really just 1 was a result of this expression OK for some pretty but
for me I don't want to know this
value I prefer to see
become aligned the LexA depressive interpreter compiler everything about them that and when you start to modified OK you you have a Python program but I'm just interested by the sequence the words when you execute the command
line you have that firstly rather than like offers a
Ghanaian just executed by the bite and let's see what the Bible that's you fine we know that the Python library began try on Windows OSX or just on my next you will get the same result OK if you want to embed fighting with your software because you development of software and so was just use the Python library cases where the
authority over time uh when you when executing the cells that automatically we will handle
slices if I turn it we tried to go some others and read and read the source code to convert it to a new city and of so the lengths of the legs as does defined if you are interested of course is the topic of the store so you have a tokenizer let's see this is the tokenizer we take a string by considering reconvert in some key expression not so into the additive constant and tokenized but for example if we take its equal to mark this to we have this is this research with men of moles we have 6 tokens it's so can I ask 1 type environment OK you can learn more about which you want to use it for a disassembly
of all if you want to use it December by and you know that we've by country that's 5 we have used work to new keywords assigned a weight and fact is not the rate you were invited just a function of the definition of your code of the keyword or not the pressure is reduced model that if
you really make an example of a senior were true in this case is just a name particularly if we try and then make no yes if we check is that indicate that that you would lose the fight on a small is just that when so and the of the you have your content we can convert them in yes you just the produce expression it's equal to 2 we have a model with a body the in the body we have an equality and equal is just a man with an idea because and we have to have where we we had the 2 numbers for the combined you have the honesty and would like to convert it to about the bike just to q
disposed combined you have
you treat it used to be and you can convert it to the bike with this model we can see that the device if you want more information you can read this documentation respect yes and no OK for provide purely here this year we have a definition of what the fusion of the biclusters just a compartment through 1 the award is just 1 by the like
whatever then when want buy just by 1 parameter all my many and yes it's just used by over too much in the skills of the interpreter but eventually when we as
this and to find and try to convert we receive a bike bike and just nothing welcomes the oral and written the values just an empty when you create a new findings and amplifies the interpreter will execute he should try with
assumption and try to convert
but we get the reason of then you have the right to only after that we try to optimize the lecture with the people of for example we have it's equal to this system we converted to 4 OK you need a little don't want to try and to have true more example another example if want to print we have used by 8 0 there's nothing we remove the data became if you the people so know we have the people are with about cure culture interpret the interpreter is just of interest admissions but this vector machine we executed by cured just
a stacked with pollution among Republican we executant thing with look OK so that's 1 example where we tried to
critics 1 interpreter maybe there's a very and you this but interpreter is just we have a stock of pointer on the and instructions the switch then we're worried intersection In this case just created a small by example firstly I try to push flies 1st again 3 and them and the rest is just part of the book when I'm going to read the source code divide through by the and interpreted as I push finding the stock Austria which can just add I reported to lieutenant and I get the term fatigue after that I will have another venue data so don't know the true and the true value on the stack and and that they can adjust a candidate for I will have to and with the rest of the system
so the remember this ancient just that we have about the
vital and yeah we have 2 by 2 just and now we have some part of the by executed by the Commission when you execute device for example we we had we have little foster here in the example those last week you describe just object on going to something and I mean the stack of the memory of the sector in the free for those bones and try to get the value from the consensus in the robot scientist and the look at and try to be used and just push in the stock OK when I try to used the binary had not the system will check if it's a stream it's not just train OK maybe a number this is strange we create a concatenation and consists of a number of you just add 1 to the normal world 1 and 1 and after that it's worth the results on the effect forest or product we have to this sort of like OK so uh for the rest just 1 of the a curious of you can use to the density
that in the source code of Python we have evolution I would think community can uh we have the distinction by heavily about from makes the system will try to read the source code and have it in and of themselves the main function is just this function phi heavily from the reference
a function with 2 thousand lines of code just 1 function of and there's a hot and so on in the function because sometimes some compiler to compile and also to prevent and the future and which we do for all the way into different theories and models we switch so for the next by OK so I have a summary
summary just we need to improve the documentation review some batch and try
to improve the issues if of program like and I just reform notice that here because when you put it on my kid because I'm not occurred over the over but I try to have a high and contributed to see if I can yes good for you but not a small example I wanted to show you what about an issue of uh but issue a small functionality for me value from the you like the bookie 1 and just
modifying the C. just so we was more patch and sometimes I want to learn the bike OK and we had to create a small the where you see on the left of the source code vital source code and the right to buy your get would like create this my example idea from OK is another version of Python version of today is you print a this just a little pessimistic as a feature and white and you don't know if you want to see the bicycle the these features in the source code of white and seems to want to use is that you if you
define interests you will
get the bike to and the value of documents OK so modeling point then the final 2 minutes what's going on man In the foam
forum I'm thank you very much
depends on guided states that the wonderful to know that someone can go from not being a contributor to going to a conference and becoming 1 2 3 years ago stiff and penultimate told now he really is an actual contributed Python anyone can do it all I'm saying is if there is a wonderful thing but it makes it really you know there is a quick question before we move on to the next or . 1 question you can have the honor of being the person ask that question it will make you special still yes what is the documentation available in different languages and is that we did in those translations of to the condition is divided in different languages lacking French and Italian Spanish was only in English not the condition is just another in english of course because of the the fronts but I know that in France there is the a group DFB they tried to call to translate French no if you want you can download the sum of the documentation of course just a clone of the it was try to translate it and in the last version of last since 2 or 3 years you have feature and things where you can translate the country create a French or Italian part of the recommendation by the judge on inventions that them altogether