We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Keynote: Python now and in the future

00:00

Formale Metadaten

Titel
Keynote: Python now and in the future
Serientitel
Teil
1
Anzahl der Teile
173
Autor
Lizenz
CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache
ProduktionsortBilbao, Euskadi, Spain

Inhaltliche Metadaten

Fachgebiet
Genre
Abstract
Guido van Rossum - Keynote: Python now and in the future This is *your* keynote! I will have some prepared remarks on the state of the Python community and Python's future directions, but first and foremost this will be an interactive Q&A session.
Schlagwörter
51
68
Vorschaubild
39:40
108
Vorschaubild
29:48
RoboterARM <Computerarchitektur>FlächeninhaltMehrwertnetzXMLComputeranimationVorlesung/Konferenz
AggregatzustandProgrammBeobachtungsstudieTopologieRichtungProgrammierungRechenschieberAggregatzustandFunktionalVerzweigendes ProgrammCoxeter-GruppeInteraktives FernsehenVorlesung/Konferenz
Mailing-ListeSoftwareentwicklerSelbst organisierendes SystemQuick-SortDifferenteSpeicherabzugProgrammierspracheGeschlecht <Mathematik>Vorlesung/Konferenz
Quick-SortGeschlecht <Mathematik>SchwebungVorlesung/Konferenz
ProgrammbibliothekPatch <Software>ComputersicherheitGeradeCodeQuick-SortWeb SiteMAPKartesische KoordinatenNP-hartes ProblemFormale SpracheVorlesung/Konferenz
Formale SpracheSpeicherabzugCASE <Informatik>Mailing-ListeGrenzschichtablösungGüte der AnpassungQuick-SortSoftwareentwicklerMultiplikationsoperatorPunktBetafunktionProgrammfehlerWhiteboardVorlesung/Konferenz
PunktCodierungEindeutigkeitDifferenteHochdruckMathematikCodeBefehl <Informatik>TeilmengeEin-AusgabeComputeranimationVorlesung/Konferenz
SpeicherabzugSoftwareentwicklerMailing-ListeEnergiedichteLesezeichen <Internet>DatenfeldGruppenoperationFunktionalVerzeichnisdienstQuick-SortMapping <Computergraphik>StörungstheorieMultipliziererInterpretiererTypentheoriePi <Zahl>MatrizenrechnungPauli-PrinzipNichtlinearer OperatorFormale SpracheProjektive EbeneValiditätAutorisierungVorzeichen <Mathematik>Dienst <Informatik>ZahlenbereichArithmetisches MittelKardinalzahlVorlesung/Konferenz
Arithmetisches MittelTypentheorieProzess <Informatik>HypermediaQuick-SortKoroutineEinfache GenauigkeitGewicht <Ausgleichsrechnung>Arithmetischer AusdruckData MiningLesezeichen <Internet>DatenfeldPauli-PrinzipVorlesung/Konferenz
ProgrammfehlerProgrammfehlerRandomisierungWeg <Topologie>AdressraumPatch <Software>CodeEinsSoftwareentwicklerZahlenbereichQuick-SortSpeicherbereinigungSpeicherabzugProjektive EbeneSystemplattformSchaltnetzSoundverarbeitungMAPSoftwareGruppenoperationGüte der AnpassungInverser LimesGrenzschichtablösungBimodulComputerspielApp <Programm>ComputeranimationVorlesung/Konferenz
ProgrammfehlerPatch <Software>MathematikAutorisierungQuick-SortGeradeFunktionalTeilmengeSpeicherabzugProgrammfehlerSoftwareentwicklerKette <Mathematik>SkriptspracheFlächeninhaltInverser LimesSoundverarbeitungOpen SourceMultiplikationsoperatorAbgeschlossene MengeWeb logOffice-PaketWhiteboardHinterlegungsverfahren <Kryptologie>KreisbewegungCodeProgrammiergerätOffene MengeSystemplattformProjektive EbeneProzess <Informatik>DistributionenraumBestimmtheitsmaßKontrollstrukturWort <Informatik>MereologieSoftwaretestService providerWeg <Topologie>InterpretiererZahlenbereichBimodulSoftwareAnalytische FortsetzungComputeranimationVorlesung/Konferenz
Prozess <Informatik>DreiQuick-SortMultiplikationsoperatorDatenverwaltungAdditionHumanoider RoboterSystemplattformEin-AusgabeBrowserImplementierungTypentheorieMixed RealityStandardabweichungDemo <Programm>Mobiles InternetFlächeninhaltArithmetisches MittelSoftwareentwicklerProgrammbibliothekKartesische KoordinatenBildschirmfensterEndliche ModelltheoriePauli-PrinzipBimodulVorlesung/Konferenz
Äußere Algebra eines ModulsBimodulThreadTypentheorieObjekt <Kategorie>HalbleiterspeicherFormale SpracheDämpfungOrdnung <Mathematik>Quick-SortInstantiierungData DictionaryMailing-ListeKontrollstrukturKlasse <Mathematik>ProgrammierungInhalt <Mathematik>DifferenteWort <Informatik>ComputerspielMultiplikationsoperatorZählenSpeicherabzugMereologieInverser LimesPunktZahlenbereichKonditionszahlTopologieUmwandlungsenthalpieInterpretiererCodeTermNotebook-ComputerNeuroinformatikProzess <Informatik>MAPMechanismus-Design-TheorieNichtlinearer OperatorSoftwareSpeicherbereinigungTransaktionGemeinsamer SpeicherTeilbarkeitEinfache GenauigkeitBefehlsprozessorMaßerweiterungMultiplikationMathematikp-BlockEndliche ModelltheorieVollständigkeitVorlesung/Konferenz
HalbleiterspeicherBildschirmfensterMathematikMakrobefehlTwitter <Softwareplattform>Analytische MengeZentrische StreckungSoftwareentwicklerQuick-SortErhaltungssatzInterpretiererFormale SpracheFreewareCodeInverser LimesSoftwaretestRastertunnelmikroskopMultiplikationsoperatorServerDigitalisierungMereologieDefaultFamilie <Mathematik>TaskSchreib-Lese-KopfKette <Mathematik>Logischer SchlussQuellcodeGeradeKartesische KoordinatenÄhnlichkeitsgeometrieZweiVersionsverwaltungVerzeichnisdienstATMProjektive EbeneSkriptspracheDemo <Programm>TropfenQuaderProdukt <Mathematik>FlächentheorieCluster <Rechnernetz>Just-in-Time-CompilerArithmetisches MittelDienst <Informatik>ProgrammfehlerTestbedKontinuumshypotheseComputervirusVorlesung/Konferenz
Framework <Informatik>Lesezeichen <Internet>BenutzerbeteiligungServerCASE <Informatik>Wort <Informatik>Monster-GruppeRechter WinkelFormale SpracheMultiplikationsoperatorQuick-SortAusnahmebehandlungSoftwaretestProgrammbibliothekFitnessfunktionSpeicherabzugCompilerStandardabweichungInterrupt <Informatik>TypentheorieLokales MinimumWeb-ApplikationKomponententestZeiger <Informatik>BitTexteditorLogischer SchlussOpen SourceLambda-KalkülPlastikkarteSchnelltasteVorlesung/KonferenzXML
Formale SpracheTeilmengeMinkowski-MetrikQuick-SortSkriptspracheWeb-SeiteKreiszylinderZahlenbereichBitAppletGeradeOrdnung <Mathematik>Vorlesung/KonferenzBesprechung/Interview
Profil <Aerodynamik>KugelkappeMigration <Informatik>Quick-SortBimodulObjekt <Kategorie>LimesmengeCodePunktspektrumFunktionalMakrobefehlFormale SpracheCodierungNatürliche ZahlBinärdatenÜbersetzer <Informatik>MaßerweiterungBinärcodeOrdinalzahlSpannweite <Stochastik>Ordnung <Mathematik>Gebundener ZustandDatenfeldEndliche ModelltheorieExistenzsatzMereologieDifferenteInverser LimesElektronische UnterschriftTeilmengePortabilitätMapping <Computergraphik>Nichtlinearer OperatorVorlesung/Konferenz
CASE <Informatik>Message-PassingFlächeninhaltQuick-SortMultiplikationsoperatorVersionsverwaltungBildschirmmaskePhysikalische TheorieLesen <Datenverarbeitung>KontrollstrukturDistributionenraumCoxeter-GruppeBus <Informatik>Selbst organisierendes SystemInvarianteXMLVorlesung/Konferenz
RoboterBesprechung/InterviewXML
Transkript: Englisch(automatisch erzeugt)
Think we can start Okay, so the keynote speak speaker for this morning, I don't think it needs any introduction I think everybody knows Guido, so We are really honored to have you here again this year. So welcome Guido. Thank you
Thank you. Hello everybody. I'm so glad to be back at your Python I can't believe I think it's been five years since the last one I attended
Yeah, oh and Bilbao is really a beautiful place to be. I've really enjoyed it so far here both inside and outside the conference Center So as I wrote in the program, I don't know if you've actually read that
I will have some prepared remarks on the state of the Python community and Python's future directions, but first and foremost, this will be an interactive Q&A session And So I warned you but there's still an update. It's all going to be Q&A
However, don't get unduly worried to warm you up. I have prepared a few questions and You can answer them now. Just kidding How How do you define a recursive function that computes factorial I
Really do have a few questions And I have some answers So my first question is what do you think of Django girls because I think if Ola or Ola were here Are you guys here Ola and Ola?
Oh They're they're resting they've been partying. Well, I Thought it thought it was much cupcake a really great talk. I love the storytelling I am terrible at storytelling. There is absolutely no story in my presentation today. It's just Branch to branch hopping also as you can tell I cannot make pretty slides or beautiful drawings. I was absolutely
stunned when I heard that that Ola or Ola Drew that drew her own squirrels and badgers and They were really good drawings. I was like I was I was really very impressed
There is another thing that I really liked in their talk they said at the end somewhere When we started we had no idea what we were doing or maybe they said we still don't know what we are doing
That is very much that sort of resonates with how I look back When I started creating Python 25 years ago Python celebrates its 25th year here I had no idea what I was doing. I had no idea that a programming language needed a community
With lots of different roles in the community from core developer to supporter to organizer and That's a really important thing to recognize that you don't always know what you're doing, but you're still doing important work One final remark about Django girls, I
Don't know if Ola and Ola realize this themselves yet, but they have created a strong brand in one year and Sort of if you look at their list of how do you create a Django girls event? They know how to keep the brand strong and sort of protected in a sense you have to register with the Django girls foundation
That is that is amazing skill all by itself, which which many geeks actually don't have at all I'm terrible at that kind of stuff myself So I I predict that Ola and Ola and Django girls will go very far Just based on the on their first year and that's really all I have to say about Django girls
So now the questions that you wanted to ask me for example Why should I switch to Python 3? Can't you? Can't you already sort of Give up that whole Python 3 stuff. It's never gonna work. Look everybody around me is still using Python 2.5
Well, actually hopefully They have they have no excuse for not being on 2.7 And So Well, this is a complicated question. Why why should you switch and and and ultimately I'm not saying that you should switch
I would like you to switch but I also recognize that it's difficult to switch it feels like a lot of hard work that you could also spend instead on say improving the design of your website or
Adding features to your application or a library and instead you would have to spend it on the sort of the grunge work of Porting to Python 3 and it is grunge work If you have a large body of code ten thousand hundred thousand lines of code millions
It will take a lot of effort to port that so why would why would you even? Bother why not just happily stay on Python 2 7 Because Python 2 7 isn't dead yet. It's it's going to be supported at some level of support at least With security patches and maybe security features as needed for the next five years
Well Python 3 really is a better language and for example It is a much better language to teach and so one thing I cornered one of the Olas actually both Olas yesterday and They told me and they were very happy. They said we do all our teaching in Python 3 and
I realized wow they wouldn't have been able to do any teaching using Python 3 if The Django core developers several years ago probably close to five years ago by now Had actually started doing the grunge work of making Django
Support Python 3 and in their case without dropping support for Python 2 So that grunge work actually paid off because Django girls is teaching using Python 3 Which really is a better language for teaching than Python 2 and let lots of sort of little boards have been removed from the language
That make it more pleasant as a first experience So Yeah, that's sort of Python 3 just is a better language and It is getting better over time If you look at the list of new things in Python 3.5, which is going to be come out of beta this fall
That's an amazing list of new features lots of cool new stuff Python 2 on the other hand is a fine language and it will remain exactly what it is Yeah, we'll fix the occasional bug but it's sort of it's asymptotically approaching
2.7 perfect and It's never going going anywhere beyond there so that's why you should switch to Python 3 because You will the only way to benefit from all the good work that core developers and other
Contributors do to Python is by switching So a related question May be a little dated by now is why? Won't you do a 2.8 release? Well, it wouldn't really solve any problems Either 2.8 is has no new features compared to 2.7
And then we might as well call it 2.7 point 10 or something like that, which actually is coming out eventually Or you open the floodgates of backported features from Python 3 and then porting to Python 2.8 would be almost as difficult as
by porting to Python 3 would be and Everything that you can gradually evolve into is the Unicode change Most other things you can you can write almost Python 3 code in Python 2.7
Actually from future input print statement a new try accept syntax and go on But Unicode you just cannot switch so Enough is enough. No new features I want to focus the energy of the Python core development group, which is already busy enough
I want to focus that energy on making Python 3 better so What is my favorite Python 3.5 feature? I Went over the list of what is new in Python 3.5 and I realized that that list is way too long
There are way too many cool new things. So in some sense maybe Everything together is my favorite new feature and this this goes from the vastly optimized Function for scanning large directories os.scander which will be used to make os.walk faster and sort of
It's a pep all by itself. Most people will never know know it's there But it's an incredibly cool project There's a small community of people who will be very happy to hear that there is now a matrix multiply operator in the language
There are no built-in types that Define that operator. It's an add sign by the way, but it has its own Mapping to a dunder function and numpy can start using this so eventually numerical Python users and scientific Python users will be able to Write matrix multiply in a much more natural fashion than
Calling a function Maybe my favorite feature ought to be type hints Because that's the only well, that's actually one of the two but the only major pep that I authored myself
It's been a huge struggle to get that pep accepted Which is kind of bizarre because I'm the BDFL so I can just accept my own pep if I want to but I I thought in this particular case that that wouldn't really be fair
I wanted to have a real discussion about the benefits and I wanted to have an independent as independent as possible party to sort of validate the design and Mark Shannon author of hot pie
Another Python interpreter that is faster than CPython Gracefully agreed to be the BDFL delegate for type hints and We worked out a
process and Eventually using the process we worked out the compromise and I'm very happy with the outcome and that sort of The outcome really is better because of all the effort that mark put in there. So, thank you mark And yet I think if you sort of if you caught me unawares and you asked me
What is your favorite feature in Python 3.5? I would have to say it's pep 492 Which is literally the last pep that was accepted before beta 1 It's
An await keyword and also async for and async with and It's a new more natural way of spelling coroutines That is a direct follow-up on The async IO work that I did a few years ago and I don't think Yuri is here. He's Canadian
Not that that would preclude him from attending Ah But in absentia, oh, thank you Yuri Great pep great feature and I think that a few years from now
We'll look back at on that as one of the big new things added to Python 3.5 So I guess that's my favorite 3.5 feature, I don't know if that counts as a killer feature
So another question much more humbling and a Woman named I think Lena Lena from Ukraine she knows who she is cornered me yesterday during lunch and asked me this and it's it's a really complicated reason I mean
Yes, it is true. There are many many open bugs in the Python bug tracker. And if you if you were to pick An open bug at random from the tracker Chances are very high that you'll you'll catch a bug that is years old Has several
Patches attached to it has several core developers discussing that patch to death several renowned core developers stating that this is a good patch that needs to go in Or perhaps not but Long discussion proposed code and
Yet the bug is open Patch has not been applied Why is that that are we are we just sort of is the core development group a lame bunch of developers? Do they not? accept patches is there some kind of
Old boys network were only patches written by a core develop existing core developers ever get accepted or what What do you have to do? Well, they're that it's it's unfortunately just a fact of life in any large project
I I haven't looked but I bet you if you look at the bug tracker for Linux if they even have a bug tracker It would be even worse Remember I worked at Google on the App Engine project which had lots of external developers
The project was especially in its initial stages very popular with very vocal developers We had a huge number of issues in the tracker many of which Had sort of good discussion and it was very hard for the team to admit that we just couldn't
Address them all and Sort of when someone reports a genuine bug when you you don't have a reason to close it instantly as Like that's not the bug. That's a feature you misread the documentation There are lots of lots of those too, but those get closed right away
So the ones that stay open are real bugs, but they may be hard to reproduce There are a lot of bugs in the tracker that only occur on one obscure platform Maybe only to one user who has a particular
Combination of things they do that makes the garbage collector crack up or any number of reasons there is probably some subtle bugs somewhere in C Python and Nobody has been able to find it. So those are bugs that don't have patches
Then there are bugs for feature proposals where someone actually made it a patch but usually if you read the whole discussion carefully, you'll find out that there is hesitance to accept a new feature because Either it is not consistent with other features of the same module or
There is doubt that it's a useful feature Maybe it's a three line function that people could easily come up with for themselves Maybe there is a change to something existing that is a backwards a subtle backwards
incompatibility that the author of the patch and maybe several reviewers even don't see they're sort of it's just really difficult to To sort of accept Patches and not break stuff all the time
And and I know my personal experience, of course going 25 years back 25 years back I started accepting patches from others like first they were the people who worked with me in the same office after a year, I started accepting patches from people all over the world and
Some patches are obviously improvements, but they're also backwards incompatible in those early days I didn't mind if if Everybody's Python code broke. Well, that was maybe a hundred people and It would they would all have their code fixed in a few minutes and the change the fix was obvious
Nowadays if you if you introduce a new patch that accidentally breaks someone else's existing code That other person may not even be a Python programmer. They may not even realize that they're using Python It may just be some installer script that comes with their Linux distribution
That breaks when they try to do a certain thing because some a new reserved work was introduced in the language by By an optimistic Pat patch there are just so many different things you have to worry about
Does it work across all platforms? Is that consistent? Is it easy to understand? How would you write the documentation? Do you provide tests? so also, the sort of core developers have a limited amount of time and
With open source development in general, nobody actually gets paid to Review and apply core Python patches. We're all doing it in our spare time And That also means that if If none of the core developers really cares about a particular feature and they don't care or know the person
Who submits the patch? You can't really blame them collectively for not applying the patch if you if you have professional software development, then you have presumably a commitment to
releases and features that includes if you want to Continue to be employed at this company you have to do a certain amount of grunge work and you do that in a rotation or Sort of maybe through seniority However, you resolve it when when people are paid to do software development
They know that sort of doing unpleasant work That is still necessary is part of the job with open source you have to volunteer to do the unpleasant stuff and some core developers have been doing unpleasant stuff for such a long time that
They want to take a break and sometimes that just means that there aren't enough people Who know a certain area a certain module or a certain part of the interpreter well enough to be able to accept the patch even if there are other people who say this looks great to me because
How much do those people know you you mean eventually there there has to be a chain of trust So anyway, these these are many reasons why you have many long old Bugs in a tracker there's an additional reason which is a simple statistical effect that you often overlook which is that if
If you sort of if you randomly were to pick a bug from the tracker that was either open or closed You would probably find a closed bug Most bugs are closed quickly because they are simple things
Perhaps some bugs are closed because they weren't actually bugs other bugs are closed quickly because there is a very simple to fix It's a typo It's a very obvious Problem that everybody can agree. Oh, yeah, that's clearly there is little bug here fix fix fix done
So the sort of the bugs that are easy to fix get fixed and closed easily quickly and So what remains is sort of the bugs with a longer lifetime? Contribute much more strongly towards the collection of open bugs
So the sort of I think the average age of a bug probably increases linearly at least with the age of the project So in a project like Python, which is 25 years old, even if our bug tracker isn't quite that old even if everything was was
Spinning perfectly and we had tons of core developers closing bugs. You would still find a large number of Mysteriously old and open and unclosed bugs in the tracker and that's why there are so many Open bugs in the tracker as best as I can tell
so another question that people always ask Especially journalists who? Have sort of hope to get something a sort of Headline worthy out of me out of me. What will the future bring?
What's what's going to be the next big thing in Python? What's what are you excited about in the next release? And I'm always sort of I'm always caught unawares by that question So I had to sort of think really hard before I realized that that should also be one of my prepared questions today
III I Really don't know what the future brings is very much dependent on what the community cares about and and sort of what? certain individuals in the community suddenly Decide to spend an insane amount of time on just like 25 years ago
I spent an insane amount of time on Python in addition to my day job and it sort of it took over my day job for a while and and I had had to work out an agreement with management to Be able to continue doing that
So if if there's something you really really desperately want to contribute That could become the next big thing in Python I'm hoping to work more on type hints and I'm currently on a very long summer vacation when I come back to work in August
I'm coming back to type hints and I'm going to work with other people interested in type hints and sort of really Do stuff with that feature so that That type hints are something that people can actually use in practice. It's not just a pep that has one little
Foothold in the standard library, but there are many other things maybe in a few years I'll get bored with type hints and I'll suddenly Devote my time to multi-core support
Getting rid of the gill. I mean, it's not a topic that will go away people are working on it Maybe bye-bye will take over they still have a bright future ahead of them Maybe Python will will get a boost on mobile platforms. There is now a mobile SIG
where people are discussing issues like cross compiling Python for Android and iOS and That may may sort of evolve into a real capability of doing Python development for mobile platforms Which would be great because you could write your application once in Python and run it both on
Windows Phone Android and iOS Wouldn't that be wonderful? There are also people and I consider these sort of the crazy lot but yet who knows Python in the browser There was a completely insane demo from someone who had done yet another Python in the browser
implementation it was someone from Mozilla and I think that It involved rust somehow or maybe I'm mixing up two different talks but there there there There is some great experimental work going on in that area And I think they have an interactive prompt that can import two or three important standard library modules
but nevertheless There may be something there but Sort of it's up to you And and I also hope that the rest of this this we have half an hour left and I hope that
you are going to come up with questions for me now and I Don't see people running up to the front with their questions, but we have I think we have someone with a microphone if you could bring the microphone to the front of the room and
I was actually hoping to alternate questions from men and women Is there Someone of the female persuasion, yes, would you mind coming to the front I can have a Q&A Q
Yeah, I'm the brave one So my question is Could you give us more insight into the gill problem and how this issue is being addressed?
Very good the gill problem. So Well, how much time have you got long ago Python was single-threaded and everything was happy
There was computers had only a single core At some point we added a threading facility But computers were still single core. So what a thread did what multiple threads did was they would basically just
Share that single CPU between different threads of execution Python at least C Python and the gill is a C Python problem primarily
Is implemented in C and if multiple threads Were to access the same object from C code They would run into race conditions Race condition is where two threads try to update some shared piece of data and
They sort of they get confused like you add one to a reference count and this is a real example Suppose you have two threads that are both using the same object Because C Python uses reference counting as the primary garbage collection Mechanism they both want to increment the reference count
So the way that is done is they read the reference count into a register add one to it and write it back So in in multi-threaded code if you didn't have the gill Two threads at the C level could do the same thing. They could both read the reference count suppose
It starts out with 42 they both move that into a different register a Updated to 43 and then write back 43 and so now the reference count which logically would have to be Incremented by two is actually only incremented by one If there are no more race conditions
Eventually, the object will have a reference count of zero well, it actually ought to have a reference count of one at which point it will be prematurely freed and Then the remaining thread that still has a reference to that object will continue to use an object
But it's actually being freed and the memory has been reallocated to some other object and all hell breaks loose so In order to prevent this one solution could be every object has its own lock and in order to increment the reference count You first grab the lock for that object, then you can safely increment the reference count
Then you release that lock or maybe you hold on to that lock as long as you are accessing other parts of the object That would require a lot of locks and a lot of locking operations and people have experimented with that approach and the problem is that if
Your program does not need multiple threads Just the locking the sort of the locking without Other threats content contention for the same for locks Because there are so many reference count operations and so many other situations where you need to Keep the data locked or the object locked before you can do anything with it
Even read it because someone else might be write it Might be writing it It would slow you down like a factor of two so Python would be twice as slow Just in order to be able to support multi-core and so you would start seeing
Benefits only when you use three or more cores in parallel Also, this would have been a very Difficult architectural change to see Python and it would break all C extensions
so rather than Introducing per object locks. We introduced a single lock that locks the Essentially locks all objects together both their reference counts and their contents And that is the global interpreter lock, which if you look in the code
I'm not even sure that it's called global interpreter lock although by now there might be a comment saying this is the global interpreter lock because that The term was invented long after the concept was introduced in code base so the problem is that Fast forward 10 15 years from the introduction of the gill
Now multiple cores are commonly present on even on laptops And people actually would like to be able to write multi-threaded code Without having to resort to multiple processes currently using the multi-processing module
you can use multiple cores, but there are certain costs involved like You may have to Re-import all code in every process You have to serialize through pickling your objects
So very large objects or very large trees of objects are inefficient to pass around back and forth and So multi-processing is not a complete solution. So People would like to see multiple multiple threads supported in a way that doesn't require the gill or maybe Maybe we'll have to break down and do something like the the per object locks
We if You sort of if you could design a language from scratch that didn't need a gill You would probably design a language without mutable objects or you sort of
limit the mutability to much more Sort of to a small number of specific object types rather than making pretty much everything mutable from modules to classes to instances to dictionaries to lists
You're taking the words right out of my mouth So we have to find a compromise like like almost everything in life in my experience at least involves compromises And we have some exceedingly clever people who have been thinking about this
For a long time and exploring different Different Ideas like Armin Rigo is working on software transactional memory Probably has been working on it for five or ten years There's also a guy Trent Nelson Who currently works for continuum analytics who?
Apparently also has a brain the size of a planet because he managed to at least on windows only on windows introduce Changes to the reference counting macros in Python and changes to the interpreter that make gill-free execution possible in limited situations
So hopefully something will will eventually happen there and there are other people who are threatening to sort of Bang their head against this particular wall until it breaks and I I expect that eventually we will have
something breaking through that wall, but It's gonna Be a while if you have ideas about this Without change without just redesigning the language so it would not be Python I'm all ears
And I'm all ears for the next question Hi Are yourself using pi pi I mean do you like the JIT do I like the STM and maybe in the future?
Do you see the pi pi being the default interpreter? so How do I see the future of pi pi?
Let me try again if you yourself are using pi pi and How would you like this the features of JIT the features of pi pi like JIT and STM If you see pi pi that it could become the default interpreter for my tongue
Okay, I am not myself using pi pi It just doesn't naturally come up I have occasionally downloaded it and and played with it for a few seconds and I'm happy with what I see but I
sort of I Have two basic modes in which I use Python myself and One is I write like very short scripts to solve a very simple Problem Almost more like a demo and I have no reason not to use just the Python that I've already built
From the C Python sources that I always have in four versions in my home directory The Other mode in which I use Python is as a Dropbox engineer and We deploy code to the Dropbox production cluster, which runs
specially modified version of Python 2.7 Yes, I said it it's Not a secret There are actually a Dropbox. I believe there is
One small service that does use pi pi because it is faster all the rest of Dropbox does not use Python does not use pi pi because it is not sufficiently compatible or perhaps because we We would be worried that there would be a hidden
Incompatibilities somewhere that would break our production in a very subtle way and we have enough of that without Having to blame the language Nevertheless, what do I think of pi pi and the
The features it provides I think that pi pi is a very good tool in in the fight against complacency Pi pi shows that you can execute Python code faster than C Python does
pi pi shows that Sort of pi pi provides a test bed for interesting ideas like STM If You if you look at where pi pi is actually used at sort of at a large scale
You would you would actually have to ask the pi pi developers. I believe they are talking they're giving a talk sometime at this conference My hunch is that The sort of Conservative stance is to not use pi pi unless you have a proven need for the extra speed
Unfortunately that sort of that That is a self-defeating Principle because by the time you know that you would have benefited from the extra speed You've probably already deployed to enough different servers
that It would be a major engineering task to switch and Again, just like people don't like to have to spend engineering time take it away from feature development or application bug fixing and put it into
Porting to Python 3 they also don't like to take put that effort into testing with pi pi And There are real limitations to pi pi in a typical deployment like a Dropbox. We have hundreds of third-party dependencies Some of which are very old. I think one or two of which
We only have a binary for Or at least we we have lost the art of exactly how to produce that binary from the sources that we also have That mean this these are just I mean if you ask anybody who has a million or more lines of Python code
The stories are the same that mean that it's I'm just I mean a few years ago. I would have been able to to sort of tell you similar stories about Python usage at Google I No longer work there. So I'm I'm not telling but I still know what
The situation there was like a few years ago Maybe pi pi needs a better marketing team Maybe they need to hire Ola and Ola the brand specialists
To improve their their sort of The perceived quality of the brand Because pi pi is really cool project but There are all these sort of checkboxes that are hard to check off that
Make it easy to say. Well, we'll go with with the tried and trusted Python C Python 2.7. Hello
Instead of asking one long question. I'd like to ask five short questions So they just need one word answers. Okay? so the first one was What is your favorite web framework What is my favorite web server framework? Oh my sorry my favorite web framework
Well, I only ever write one web app in any framework and then I don't have an opportunity to write stuff for a long time and then When I have to do some more web stuff
I There is a new framework, I think the latest one I've tried was flask and I don't know if it's my favorite, but it's cool. Okay, and What is your favorite testing library? my favorite testing library is Mostly just the standard library unit test and mock
In Python 3. Those are all especially mock It's very good in Python 3 in the standard library and what is your favorite text editor? My favorite text editor is Emacs Emacs But if you'll allow me there is a funny story here, which is that I also
occasionally use VI or VIM and for for Historical reasons because I I used them 30 years ago before I was introduced to Emacs and switched
When I use VIM for five minutes It takes me 15 minutes to get used back to Emacs after I switch back to Emacs What is your favorite language besides Python oh
I used to say C, but that's kind of boring I Have it from from people. I trust very much that the modern C++ is Actually a really good language
With like the type inferencing and lambdas and smart pointers I've dabbled a little bit in that and I Found it certainly much more pleasant than old C++. Like I remembered I
quite like go although I have never actually written anything significant in it and Again Mostly from looking at it and talking to the designers a little bit. I really like Swift I think Swift is a is a well-designed language using
Sort of the steel steel features from other languages that you like which is really Flattery and so they stole quite a bit from Python, but they also managed to sort of Make the Swift the language quite coherent
It's easy to sort of come up with a language that steals the wrong features from all different languages and you end up with this This horrible Frankenstein monster of a language but Swift is the opposite thing They they combined it all they only stole stuff that fit well with their core design principles It's Swift open source there. I've heard that it has recently been open source
I don't know how many teeth that announcement really has it could be that there is a real compiler that is not open source that this Apple optimized or all sorts of Reasons why open sourcing is not always the same as open sourcing. Yeah
Okay, and the last question is what is your favorite exception? What is my favorite exception a Keyboard interrupt we have 10 minutes
I would like you to hear your comments on the vitality of the Python community compared to other
language communities, how are we doing when it comes to general acceptance, how are we doing when it comes to innovation in the language I'm like the worst person to ask to compare the Python community to other language communities because
I'm like totally at this the center of the Python community where everything seems hunky-dory and firing on all five cylinders and Sort of new stuff is always coming along and and I see lots of women in the audience
Much more than five years ago, I believe So I I see our community as incredibly vital and and Growing and and successful and I see the language as being very successful, of course you
Someone who happens to be a big Java nut and who has been doing Java work for 25 years might perceive the Java community as exactly that and sort of at the periphery see this Little Python thing that never will amount to anything so I I don't know how to compare I sort of I can
easily name two language communities that when I started with Python were much more vibrant and have now sort of dwindled dramatically pearl and tickle TK both
In in 95 I went to a scripting language conference and I met Larry Wall and John Oosterhout and a few other people who had done scripting ish thingy Scripting languages things And I was really looking up because pearl was like everywhere super successful
O'Reilly was running pearl conferences that had thousands of attendees or at least that's what it felt like Tickle TK was clearly number two in that space and Python was just a sort of up-and-coming little guy who
still had to prove themselves and had this big disadvantage of the crazy white page space shit and Focusing more on sort of elegance than on Being able to really quickly whip up the most crazy script in one line and
Somehow Tickle TK pretty much got destroyed when Oosterhout decided that he no longer wanted to lead that community it's my feeling and Pearl I think was severely damaged by the pearl 5 versus pearl 6
rift and that sort of even when I started with Python 3 I Could see that happening in the pearl 6 world and I wanted Python 3 to be much closer to Python 2 Now you could argue that looking back. I still didn't know what I was doing
but they still think that as a community we're strong and So but maybe comparing us to pearl and Tickle is easy Ruby is A very very sort of happy community. I believe much smaller than Python, but I Don't really know any numbers
Yeah, there are sort of big languages with lots of followers PHP JavaScript that I'm sure are pretty happy but I
Know I mean at every Python conference there are always plenty of talks that explain in much detail Something cool about JavaScript for example, because you can't get very far with Python without doing JavaScript Yeah, hi, so this might be a bit like the pearl five and six thing
But are there any circumstances where you would accept breaking the C API of Python modules that? You would actually consider it worthwhile to have people do the migration work to something new
Thanks Breaking the C API. Well, there there are sort of two different ways of breaking it There is an ABI which is a limited set of C API's where we strive for binary compatibility. So a
binary extension module compiled for Python 3.4 Should work with 3.5 and and actually there's quite a wide range But you have to sort of limit yourself to a Sizable but but still limited subset of the C API
On the other side of the spectrum you could argue that we're not really breaking the C API when we just change what the macros do and people who experiment with
Say Guilfry coding often Redefine the reference counting macros to do something else either sort of implicitly acquire lock or They turn them into no ops because everything is garbage collected anyway, or they invoke special
platform dependent Atomic increment and decrement instructions Which means that you would have to recompile C extensions in order for them to work, but That's still arguably is within the bounds of the C API
Although not within the bounds of the the ABI compatibility beyond that We we have occasionally I believe Changed
API's where we found that The signature was just wrong we've but but we've we've almost always we've introduced a new function with the correct signature and Mapped the old function to something that was backward compatible. So we do take this pretty seriously and
so the thing is that For so many people Python is just a glue language that is used to glue various extension modules together That if you break the ability of using of using extension modules
Albeit, maybe a requiring recompilation of everything Python's reason for existence would would disappear Which which is unfortunately also part of the story of the difficulty for pi pi acceptance because pi pi
Typically has a very different Sort of natural API to talk to its objects from C code or C++ code last question Hi, I have a short question. What things you hate about Python?
What things do I hate about Python? Anything having to do with package distribution
Version Sort of Version skew version dependencies that that is just such an endless mess I Dread it whenever someone at the company where I work Says can I ask you a simple Python question because almost
Invariable. Well, let's say 50% of the cases It's not a Python question at all, but they've got some kind of mess with the import path And there's just there's just no easy answer So those that that's sort of the general area of Python that I hate
So we're out of time. Sorry Okay. Yeah, we're out of time No, we're no time for other questions. So thank you. We do very much for And we have a very important
thing now we wanted to thank we do for going in all the keynoters, so from Organization we want to work
Thanks, mom. You don't know the keynotes. So we want to give him a present a very typical bus Present we forgot yesterday to give to the olas. I don't know if they are here They are Seeing us from a streaming or they can came
Together thank you again. Thank you guys
So now we are having coffee break
Just another reminder don't bring food to the room. Thank you