Protocols and Practices enforcing in Python through bytecode and inspection

Video in TIB AV-Portal: Protocols and Practices enforcing in Python through bytecode and inspection

Formal Metadata

Protocols and Practices enforcing in Python through bytecode and inspection
Title of Series
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
Protocols and Practices enforcing in Python through bytecode and inspection [EuroPython 2017 - Talk - 2017-07-10 - PyCharm Room] [Rimini, Italy] Python is an interpreted development language with powerful introspection features, up to allow accesso to the byte code itself to see what the virtual machine is going to do. Reaching down to byte code or low level inspection is usually a very uncommon need and it's usually only involved in debugging or understanding the interpreter internals, but it can be a powerful tool to check that third parties code that (or the code we will write ourselves in the future) sticks to some protocols or best practices that are supposed to be in place. Most of the needs for this checks are usually performed at execution time or through techniques like metaclasses and monkeypatching of third parties code, but in some cases it would be possible to inadvertently skip those checks or work them around, while verifying the resulting byte code allows us to check what's really going to be executed and enforce the required constraints
Intel Turbo-Code Software developer Multiplication sign Water vapor Data storage device Web 2.0 Cache (computing) Binary image Forest Software Software framework Communications protocol Library (computing) Sigma-algebra Software developer Structural load Bytecode GUI widget Moment (mathematics) Projective plane Interactive television Data storage device Sound effect Database Template (C++) Arithmetic mean Software Interpreter (computing) Software framework Object-relational mapping Website Library (computing)
Pixel Sequel Computer file INTEGRAL Augmented reality State of matter Code Software developer Multiplication sign Data storage device Sheaf (mathematics) Rollback (data management) Database transaction Mereology Personal digital assistant Well-formed formula Personal digital assistant Authorization Software framework Library (computing) Physical system Form (programming)
Functional programming Computer file Software developer INTEGRAL Branch (computer science) Mereology Computer programming Expected value Web 2.0 Object-oriented programming Different (Kate Ryan album) Single-precision floating-point format Software Energy level Software framework Communications protocol Error message Form (programming) Physical system Condition number Software developer Forcing (mathematics) Interface (computing) Projective plane Computer programming System call Type theory Particle system Software Integrated development environment Function (mathematics) Object (grammar) Aspect-oriented programming Library (computing)
Web page Point (geometry) Computer file Software developer Mereology Number Product (business) Expected value Web 2.0 Type theory Forest Software framework Communications protocol Library (computing) Context awareness Key (cryptography) Interface (computing) Forcing (mathematics) Projective plane Data storage device Interactive television Code Sound effect Electronic signature Type theory Data mining Software Interface (computing) Object (grammar) Communications protocol Library (computing)
Context awareness Beat (acoustics) Source code Mereology Dylan <Programmiersprache> Formal language Fraction (mathematics) Expected value Type theory Endliche Modelltheorie Communications protocol Library (computing) Social class Form (programming) Context awareness Inheritance (object-oriented programming) Content (media) Code Sequence Formal language Type theory Personal digital assistant Internet service provider Website Object (grammar) Abstraction Library (computing)
Logical constant Context awareness Greatest element Run time (program lifecycle phase) Code Source code Set (mathematics) Computer programming Formal language Neuroinformatik Expected value Fluid statics Coefficient of determination Semiconductor memory Computer configuration Personal digital assistant Software framework Endliche Modelltheorie Error message Library (computing) Social class Antimatter Namespace Computer file Data storage device Sound effect Formal language Type theory Fluid statics Order (biology) Chain Pattern language Quicksort Writing Slide rule Trail Functional (mathematics) Implementation Module (mathematics) Divisor Open source Variety (linguistics) Mathematical analysis Event horizon Declarative programming Sound effect Crash (computing) Operating system Factory (trading post) Energy level Divisor Condition number Default (computer science) Context awareness Key (cryptography) Interface (computing) Projective plane Mathematical analysis Code Letterpress printing Cartesian coordinate system System call Frame problem Event horizon Integrated development environment Personal digital assistant Factory (trading post) Object (grammar) Communications protocol Library (computing)
Dependent and independent variables Functional (mathematics) Run time (program lifecycle phase) Suite (music) State of matter Multiplication sign Code Set (mathematics) Semaphore line Mereology Formal language Performance appraisal Expected value Mathematics Kinematics Telecommunication Object model Order (biology) Square number Software testing Object (grammar) Regular expression Social class
Functional (mathematics) Context awareness Module (mathematics) Hecke operator Abstract syntax tree Inequality (mathematics) Formal language Element (mathematics) Expected value Different (Kate Ryan album) Operator (mathematics) Pairwise comparison Parsing Information systems Bytecode Code Symbol table Syntaxbaum Data mining Finite difference Compiler Right angle Modul <Datentyp> Regular expression Resultant
Parsing Point (geometry) Electronic mailing list Code Regular expression
Complex (psychology) Functional (mathematics) Kolmogorov complexity State of matter Branch (computer science) Limit (category theory) Letterpress printing Function (mathematics) Personal digital assistant Utility software Convex set Statement (computer science) Loop (music) Resultant
Complex (psychology) Parsing Kolmogorov complexity Web page Code Core dump Branch (computer science) Letterpress printing Thresholding (image processing) Number Well-formed formula Function (mathematics) Personal digital assistant Routing
Bytecode Complex (psychology) Functional (mathematics) Context awareness Code Patch (Unix) Translation (relic) Water vapor Insertion loss Mereology Formal language Expected value Mathematics Programmschleife Different (Kate Ryan album) Software testing Physical system Context awareness Boss Corporation Software developer Computer file Moment (mathematics) Projective plane Code Lattice (order) Term (mathematics) Connected space Vector space Personal digital assistant Blog Phase transition Resultant
Point (geometry) Bytecode Functional (mathematics) Context awareness Group action Open source Code Multiplication sign Image registration Mereology Computer programming Power (physics) Expected value Revision control Goodness of fit Mathematics Coefficient of determination Forest Single-precision floating-point format Core dump Software framework Task (computing) Social class God Axiom of choice Software developer Projective plane Feedback Moment (mathematics) Complex (psychology) Thermal expansion Frame problem Particle system Message passing Software Logic Personal digital assistant Phase transition Cost curve Website Quicksort Metric system Library (computing)
few OK uh 1st of all I'd probably be a little longer so if we have more time left for question someone would be all sides feel free to ask anything because the quality is quite long and try to make it as short as possible but there are many things that we like to say and uh some of them are
long and complex so I didn't have enough time to explain them in full so I you recognize that something might not be to Europe so feel free to ask me anything and the reason 1st of all the why I in here and what's the reason for is the stalled by encouraging maintaining if you buy the libraries and frameworks in the Web that moment water for Python there because project is for sure that we will just which for any of you that doesn't know a framework that the it's compatible to John when sites as of mean multiple uh of calling a database layer supports both both among the DVD and sigma likening is everything you might expect for a from spot framework and has been around for like 7 or 8 years so it's a very low big project we have a lot of work the other big projects they're relying on it so that it takes a lot of my time and then a few other minor projects like the care which is a framework for caching and sessions all web and there other side projects like that by which is a JavaScript interpreter for quite and you can use it for example to around the reactor several sidle vital more to around about angiosperms bi-level blighter without the need for load or things like that and people to which is the phi storage framework so you can see that there are a lot of projects on maintaining and the reason for this story came from the experience I had as the developer of libraries and frameworks so whenever you create something like a library if you are lucky enough you do we use the hand the hand that brought the real problems but the effect is that most of these pieces in which might be independent start to get integrated into bigger soft or other other solutions that involvement them and it's not always easy to find a way to make them uh interact with other piece of software and communicate the designed and the intent of what you've world I mean you might expect that your library does something in this very specific way you but not expect people were using eating such so where you didn't foresee or things like that and you try to do your best to and forest those ways and communicate them and things like that but it's not always easy so sometimes we need to revert to a more stricter reinforcing to to apply them so
uh this is the most common situation I usually end up as the library whenever people as a library developer when there are people opening issue of nearly half of the times it's because they use the library the way that I did them pretty store CUI they didn't mean that all to be used like that for example the most interesting thing was recently issue was open to me for deep of which is the fight storage framework and there's a deep integration we've seen
like me so whenever you for example commit your transactional rollback you transactional things like that your files get deleted or save for me all according to the state of the transaction so for example if a user uploaded the use of authority and that you were a transaction fails because because don't the kind of the other of the user is not left there on the score on this free or wherever you uploaded the pixels or all that we section so you believe our own the broken fights things like that and there it was a guy that opened an issue about the fact that he didn't work well with John wherever as they you have got it supports the work we sequel like it's the 1st one being the the mentation and things like that and then I started actually implementing support for handler and because people actually was to use it on that the storage system utterances so you're you try to cover with every might be possible misuses of the library on the framework of the code you wrote and you try to do that in the augmentation you show people all the way they are supposed to use the library but it's nearly impossible to show them all the way they do you should not use the library you you should try like you I could write these once we've signal like any and longer the which is what I did and I like a lot more more part after the augmentation see doesn't work we're giant whereas and and probably some of you try to use it we've Mungo engine and then I will have to say that that what women Glenshee only means a form of the and things like that you will end up trying to list all the cases all the things that people shouldn't do which is impossible because our formula would say only so are you quickly discover that you definition of what's reasonable as a way that your library or framework should be used is not easy to guess a common definition that then your fall on can so I knew don't know what to do anymore I mean I already did my best
I told you how to use the library I told you while you should lot plighting your project I brought examples I wrote documentation I even provide some simple projects and things like that but there is always something you you can't force you have been pretty so there is actually a branch of software development that comes into our well uh regarding those kind of
things in the these there I would say a kind of science this is called defensive programming is a really common really be projects like if you need to write a soft would derive a space shuttle you will apply a lot of the things that come from different C program like not true false the requirements or like double all fullback systems for every single software PC brought or things like that so uh they're particles of defensive programming is to defend you from being possible because each we let and they're more formal definition which I took from wikipedia so it's brushing nowadays it's probably the standard definition is what you read the whole we began is that it's a form of difference is designed so way you design your system not much in the way you frightened uh on call level to ensure that the continuous effort to function under any possible single or in the doesn't work anymore least issue uh notified in a clear way what's going wrong instead of just providing random error which is usually with that and there are a few things on defensive programming which we actually take for granted we have used to them from object-oriented programming from aspect-oriented programming and from money other part of things like that you have interfaces in object-oriented programming you out why environs steel of types in functional programming so those things are actually go under the umbrella of defensive programming so as they are a way to prevent you from doing the wrong thing so like uh if you are subclassing an object that does those things you are expected to do those things so if you are working we're a specific type you are not expected to mediate the object itself which might have some but you're expected to create a new 1 and all those things are usually undergo go use only under the umbrella of differences program and you will not that all the things that are involving defensive programming usually are assembled brought of those and expectation so the how you want to communicate we've other piece of this system and what's your expectation in the way the other piece of this system we what what they're going to and things like that for example if you are a so it's framework you're supposed to store your files so where you're not actually supposed to provide to web sorry gene not know where which is actually 1 of the future that 1st got requested on people for example people start asking for a way to 4 I really fast this unique that involve the integration we deport and say why we can just make people do nothing when you saw something so that might test is fast and vibrant watching divided the scum the by defining these corpora upload a file with for or things like that so there whenever you whenever you face a condition in which this offer refuses to respect your expectations you should provide a clearer however to the use of that he's doing something wrong because you cannot
rely on the fact that they read the delimitation of things like n I would say that that has these softer the users your library as expectation of of your library I expected your web framework when my page I expected your phi storage framework saves my files I expect that whatever you're doing doused with is expected to do so in you're library should that expectation to so you should never expectation in your regard how the user is going to use so try to enforce them because it's 1 of the major pain points when you start getting involved in many different projects that do many different things and there are actually parts of
the protocols force in which we are used to bring our daily work so whenever you write a piece of software it doesn't need to be here in the library or a framework can even be just something used in a single project my baby 4 different places of this project at that point you will have to provide the key of expectation than you usually do that through interfaces to the signatures of your made of 5 assertions and all those kind of things are actually a way to express a product they probably in the sense of how your object or you're library interacts we bother libraries and objects and you actually need to provide this petition for each single that you're library will have with other people code so any single piece where you're library can interact with something else shouldn't forest elicited fiction and I'm not talking about the most while like mine adults too few co-lead you're supposed to pass a number that's that the something we take for granted it's obvious that if you expect the number you should check that the thing that you are receiving as least resembles a number of can be converted to a number if you want to apply that typing or whatever you want to work we but I'm also talking we side effects like uh if you so that produced both fall I mean there was a clear our problem side effects in import I do part than I expected well I find module see is
actually the model that are important but there is nothing that beats enforcing that for me it just it side-effect of how they policies warts and it's not actually supposed to work their way for something else might have changed the content of the part as a site the effort of import so those are all kinds of expectation that the library should shouldn't forms in the context where it runs the in and the fact is their context is pretty hard to define in something like a dynamic language and in this case uh we actually have a few tools that can help us in many ways because the fact that it's a dynamic language it gets assigned efforts like it's not always easy to specify the proud of us your classes or objects need to enforce now we are starting to see improvements they try to do opposite abstract base classes they tried to do typing thing in more recent fractions and things like that but usually
piconets a legacy of being there typeless language most then but the fact that it's so powerful and flexible in managing called types also means that as powerful and flexible tools to inspect what's going on because Python itself has to do that to be able to treat your objects as they are something it has to a powerful tools to check what that something he's so all I can provide source poetry infection because the language itself needs them for you on that the debates if you provide something that is suspected to work on this sequence you and that's probably a case every 1 of you ever faced you know that it's really hard to check what the sequences for but we have a definition collections we have enough not a base class that states I'm a sequence but actually for the
general idea of what what the sequencing use many types that are not expect them not to respect that that key that interface are actually collection so it's not uncommon invited to see complex checking all what kind of meat dogs or phyllotaxis sort things like that and we are really uh doing inspection in the context of the binding whenever you saw start crashes you expect to be able to going to the quadrants see what where the lot of variable what was the previous frame and go back and forth across this calls back and things like that all things that Python endows because it's a dynamic language if you ever work we reckon by language like see your so that it's not as easy I will say it's you possible so now if you have an understanding of how the internals of the operating system and computer work but it's not this it's easy to move across used that of colds and things like that as a least you must know for example where in which place of the memory you varibles will be your things so that 1 in Python I can just get the frames and from the frames the lot of articles and reviews what made my function truck the and 1 thing that the library can do is leverage all these tools to inspect their surroundings in which it is running to check that the expectations are met so I will try to show you some examples to train a fighter constant because so far was a really tropical told so I told you about uh protocols enforcing of expectation defensive programming and things like that but in practice what does it mean how can we apply some of these things to fight and I Triton resembles some of the most common and the patterns that we see offering are some of them I really widespread even tho there over many side effects and things like that and 1 of the most common side left Python uh which is related to the previous import uh example is side effects that import we often rely on the fact that whenever pythonimport Simone each runs the code of that model so we tend to see light classes declaration and things like that not actually at declaration partially implementations of those that actually when they get executed create that class and is common in for example in the context of reduced in something like so peoples come commonly use like decorate doors to reduce the a global objects of the storage is an object in a global reduced their like these these linear if really simple example of something like that it's really common in the context of uh event and allows attendants and things like that it's really common to see these bottom which involves some having some kind of registering which in this case is just a dictionary and some kind of the correct order that Clouseau which he then your function should be called so for example my the correct or we reduce the of the function that you are providing as a handler for the event that was specified by the court and they're whenever I want to fire an event I just look into the all the reduced vendors and call them like in this case it just goes through all the event and those for that event and calls that and this usually ends up being something like the sole on him and some even that might Easter and then I finally of the event of a and moon there is 1 more complex problem in these examples which is in what seemed the most common cases he was in the case where your model gets important then you reduce the the event that the global namespace but what does happen if I do something like these I become refractory of which is I will say up pretty widespread pattern in many cases and that factory middle creates something that there's a even and and here's sort of our problem if I fire the then I will see getting fire if my factory was have local before the event was fired or it can never be fired if my factory was called after the event was fired because he would never reduced of the event and because my factor never was called so that the correct or never was applied and so my function never was called when of 5 the event and is is OK if you think about it it's findings that way you you know the language works you say you never create that so I'll call you register it doesn't entirely it's pretty obvious at that point but from the expectation of a new user replied to in might be more obvious that by the reduced that functionalism the rent under nice speck to be called because it's seen Michael so this is an error that you might face if users use your globally reduced around and then my like opening issue long you tub and say that these entièrement and the never what they were but yeah of course because you never have shown here that the body will be better if we call find that these is an hour a week will tell the user you should not be doing something like that and it is actually a condition we can set so we can actually implement something the checks for that so we can implement the gist of the correct or that DalI's traps the countries where it was used so the In this example that we have the same exact register the correct or but we are using the inspection features of items to check that the current frame where that actually Department of the current frame where there were decorated whether they even Canada was reduced is at model level so OK this might not be the clearest way to do it might not be the most silicon way but it wasn't you was short enough to stay in a single slide and that's what I wanted to show you is mostly the idea that might have and then there should be in charge of checking that he was using the correct way so in this case is in charge of checking that the place where the M then there was reduced the it is not the transient school so it's not something that might or might not that is something that we all exceeds OK at least in this sense that you usually import all the models as the 1st thing it of course if we break again if you use lazy imports but they have all set of side effects so you usually don't want to use them so in the most common case that you will war the and in this case I tracked the fact that the user register at the event then the in this scope that it's not blob all so it might be there or might not because the only scope that we know it's always start the global 1 option so and provide the memory so that whenever the user tries to use my different or at least the gets in our that there's here you are adjusting the event and the to a turns in scope maybe I cannot 1 more option and say yes to really do that because I know what I'm doing I know that I will always call the factory before finding that have but in the most common case I should part right track that and tell the user what what you're doing something that we'll close issues to you and this is the case using this call of tools like static code analysis tools that usually do things like that they check on the bottom so everything you sure you are not supposed to do and they usually do that really well at the language level because they know how the Wango languages was supposed to do but they are not really useful in the context of checking your so I mean you're told the sorry that might be misleading definition the decoded you variety and as expectation you which I think you're called uh solves the expectation of the language of the you won't be able to check that the other libraries that use your called uh solve the expectations of your crew because you will have to write custom checks for that weapon and in many cases those 2 was another really easy to expand the you need to learn that 1 you framework in need to pride ourselves and things like that because a on checking the the syntax of the language that rely checking that the source code itself not the runtime is 1 and there are many things in a dynamic language like Python there are lot easier to hold true for a c without actually running the code and uh if you ever use a development environment like my chart who we had in the room and you will probably not is that it's not
always easy for you uh it taught to guess the correct 5 song what's happening at the called because he doesn't really know what's going on when your on that course can try to guess what the there's no guarantee that the gas would be correct and there are actually 1 more dependency that you must have 2 you were to a chain so if you need to work on a new project is 1 more piece that you need to set up before working on the project and is you try as you are more and more of those dependencies tries in tends to be a pain in the arse to start working on new projects and people start to complain and they don't want to contribute to the project and more things like that so for an open source project is not always a really good idea OK here comes another powerful feature a Python we choose inspection
when we have a full set of things
that we can inspect the runtime and the do a is that you can actually inspect not all of you recall about you even other people but the main problem we especially those the user really expensive so don't try to do that that's 1 time usually you want to do that at test time so why you test which runs and you can inspect partially anything in the language not just objects models and classes you can inspect even code itself which is the really interesting part because we can check what other people are doing we buy our objects in our clothes and our function and there is 1 simple example In that tries to explain you why inspection of the cold kinetic you understand what's going on OK so for example we might have arrived applied and the communication and the states that all the quality you uh uh operate torus evaluate for left or right at the same order so we probably think that writing something like that to read falsely inflows call applies we'll talk about respond this In true value because we compared to 2 falls and that's false of course semaphores seizing that use that contains sports so there might be an expectation that we have before we evaluate that expression from left to right as the documentation states but that's not actually true because if we tried to put squares around it expression which should change nothing because you should still get on with it from left to right as we just place this well on the left part of the expression there is on changes why that while it's not so easy to guess espresso so who
my 1st especially when I saw these was why and we have a few tools that might help us understand what's going on 1
in this simplest 3 expert inspection and the other is the by right of the of inspection the 1st thing that and I'm going to show you something inspected by itself so we can use a symbol our function and R. what's going on here L. we now clearly see what the language is doing what's going on is that Python is going to compare to to false and if that comparison is false if we move away jumpy follows means going away from what you're doing next and jumped to 11 27 which is the end of the function so we thought least keep their right side of my expression if their left side useful a wise where are we going to the accessing the streets now that's clear why Python is doing that because the expectation of Titan is the friend than mine by them expect you to write something like that to express inequality here in the context of 3 different elements so all you the operation those those are not too different operations it's a single operation that he's compare compels the less value to 2 other things using 2 different comparison operators so you're not actually saying compare the 1st when the result of the 1st and compare it to the talk that I'm not saying comparing the 1st element to these and then to that if any of the comparison is false that what expressions for but what was missing was the way that I brought it because I use the in operator if brought in these way In the
2nd example here you would be clearer to any of you probably why might be behave that way because in this expression is clear that the we want all the 3 things to be equal while in this expression is not as clear to me to explain that we want to be false and also in the list that contains false and 5 OK
and now in this simple expression is easier but it's not always easy to guess what's going on and you go
down to the Czech and those kind of things and now i any to Russia me because I have only like 5 minutes so the next example would be pretty fast if you ever want creature collected complexity results are much complex your Cody's saw many branches utility is taking and usually is good leaning it is stated to be around 7 so if you're convexity goes over 70 means that you call starts to get too complex for humans to fall wearing
and we if we have something like these we can do it which is just a function with 2 different branches to a different if branches we can compute that she traumatic complexity by decoding the called of that function so I need not be
something like these which is divide and
then checking the number of his and the 4 routes that might call the running so is the complexity that gets from that formula so counting the number of the friend counting the number of foreign not 1 which is always the main branch itself is over 7 we can provide another to the use of the visual reference so we can see the use
of something like the code inspection to enforce uh best practices are called like check that your complexities lolled refractory your code when it gets too long we can check that for example the function is no longer than its it's different for loops and we can say you be too many things into this function usually
refractory and then once you understand it you are able to inspect what's going on around you what should you do the 1st thing that I suggest you to apply inspection use when you water maybe project with other members of the team it's really common that in that context there are some parts of the system that you understand very well and other people understand the last thing you because you are probably the main developer of that part of the system and it's really important for you to be able to set expectations during the test of that part of the system you know someone as my interview spots that he view doesn't even know what it is causing because it doesn't know how you code works for example 1 of the most recent cases where I use inspection he's these example I've tried to explain the best I can even do I recognize that without the context but what was going on it's not really easy to guess was suppose that you have some cold that destroys an entity OK so it might be whatever it got lost OK the size of blood loss and the blog lost as many attachments every major reveal every whatever you uploaded to that brought boss maybe does translation in other languages and things like that it and we want to make sure that in any way they call it the deletes the Boston change he continues to maintain their assertion that all the resources that where uploaded we better not boss not deleted so even if our code phase somehow doesn't laughter around pieces that were supposed to be the In this case what I did was writing a function and that of function which is gonna get me to its called by which looks at the byte code of a function of a and looks for all the other methods that were called by best function so I did something like that OK I know that this function like 20 other feelings check that any of the other 20 other things that the function doesn't leave around and history if they're thing fails and that was a really important enforcement because you know that when you tear down the resource you would expect it to be gone forever and you don't want to go and clean not things by hand because when you find them it's usually really complex understanding Mory's there are still use or not you have to go to with all the dependencies and things like that so my ques with I wrote a test that monkey patches every single meeting that was called by that middle and because this is raising our so every single minute of that was called but they this function by that you have no function now arises in 1 by 1 and I checked that closing narrowing each single needled dies and leave around any results the so this is a clear example what some expectations and voicing to the inspection of Michael because I did inspected by to find all the methods that the function was using and then I just informs the fact that each 1 of them should they leave behind any reason was as if it fails it can fail of course because we know that something might go wrong and we know that the connection to that of a system might be down for whatever reason and the use the test the and so exact moment by the way is is still needs to make sure that the data of that was the stored there will be gone whenever the collection of these vectors so you didn't really expect me to
do a talk about good inspection we dolls 2nd metrics of course and at this point I tried to do the best I could to explain you uh what's the frenzy programming was something you can do we've code inspection piled on the why you should forest the probable and expectation of your what you need to do is actually not easy for me to tell you because you really depends on your project in the context of the project I was at the it's already enough if you get out of here and start thinking whenever you write the next piece of gold about how every of a single the power in the what my niece use my function that's usually the question you want to ask yourself whenever you write a new piece of code and few
if what 5 minutes for questions if you have any question raise your hand we have a microphone for it so it that require the so the so that is there a library or something else that I can use uh sorry I can't hear you very well that is is there a library of something else that I can use to implement the functionality that you showed me a last example to get for example the function that are called by on 1 of the function OK not that I'm aware of that I'm pretty sure I saw something that does things like that by libraries for inspecting the cold or trying to look at the wrong time or things like that but I'm not really oriented to enforcing expectations so usually you can rely on them to do to get the context what's going on but none of them is really up to date usually because they Python bytecode changes some sometimes Lorilee often about the version version the mind had annual parade or things like that so allows the core developers are really committed to this project usually uh that's the I'm pretty weak like in 1 or 2 versions of Python and so all the usually in my experiences was just easier to writing myself because when a project is uh is implemented the usually bound to a specific by conventional like you use when no that that project is going to Ronald by to 7 more for you or things like that so it's easier just to take for granted in the context of a project you do for work of course that that's the version you're going on obviously for a an open source project these for every yard and use the easier to rely on the site inspection the all frames call stack and things like that and trying to going to bite for the spectral itself because in my teaching so I I don't have a clear answer to your question because I know of no good framework I was suggested for doing that but that would be my point I so some libraries but I never uh ended up using well them for various reasons so I am no enough experience in any of them to tell you if we solve all your problems it thanks so going back to your 1st example would reduce the no classes good expansions I have a it is extremely come on everybody is doing that is not so clean and so is not that clear but what you would do suggest to do instead OK about in the specific case will for example there is a really good why spell library you every 1 of you probably have above which is celery that dog has something like that for me registering past if you ever want be salary and if you haven't tried to look at its God you probably not these that the there's also some pretty complex logic to try to ensure that its finding all this task any place of the code that you try to reduce them last year there are many ways that you would call my go wrong some task you in that case that I know very well what expedient I saw that issue because was a single pass basic functions as a this argument and that by choosing the activity and task yet so that it is exactly so for example 1 of the things that you are usually due to solve this kind of uh problems being an explicit a registration phase along start off this software so for example for a salary uh we ended up writing some parts of the task of legislation that ensures that whenever they're uh whenever you start it this software all the task that reduce that that that time if any task at the reduced the than any other moment if we crash you will tell you you register that after the wrong moment so you should explicitly call a reduced of cost function in the start up a function of the course and that was a simple solution that the Dane blob changing celery March we just an add to that that's the cost the Oracle to check that it wasn't called in any other place some part of these sort of function and there are probably many other particles that you can enforce like the army does something really complex we they have ever per library which is called uh the new venues you find correct that these facts on your cold trying to find any group point in every single point on you recall that might be another solution or the prior about I guess that we will not be easy to catch them all I'm sure that the best enough time I can find a way to fool P or maybe he looking up into my code the thank you will be seeing that the things that I'm doing so please of we learn will have more time for questions and just a quick note on their Europe I found out you can read this up thing the speaker and also provide any any any feedback
you'll you think it might be useful for working for me that so please think that ended in this speaker I send their