Mark Smith - Pythonic Refactoring: Protecting Your Users From Change
"Pythonic Refactoring: Protecting Your Users From Change
[EuroPython 2017 - Talk - 2017-07-14 - PythonAnywhere Room]
[Rimini, Italy]
So you've released a library! Now you need to maintain it. You want to add features, restructure the code, fix bugs, and maybe improve the library's usability. Your users just want their code to carry on working. That's okay!
This talk will cover techniques in both code and project management to allow you to keep your code moving forwards without breaking your users' code. It is aimed at developers with a little experience of writing libraries in Python, and will cover some intermediate subjects like function decorators and magic methods.
Refactoring in Python is a mixed bag - on the one hand you have powerful tools like the @property decorator, __dunder__ methods, and even metaclasses. On the other hand, because Python code has no concept of private or protected like some other languages, it can be difficult to know what your public interface even is.
I'll talk about how to identify your public interface, and make that clear to your users. I'll cover how to structure your tests so you know when you've broken your public interface. I'll discuss how to use some of Python's language features to trick your users into thinking your code hasn't changed at all (except for those brilliant new features you've just added!). And finally, I'll cover how you know it's time to break backwards compatibility and how to break it to your users.
License: This video is licensed under the CC BY-NC-SA 3.0 license: https://creativecommons.org/licenses/by-nc-sa/3.0/
Please see our speaker release agreement for details: https://ep2017.europython.eu/en/speaker-release-agreement/
Видео Mark Smith - Pythonic Refactoring: Protecting Your Users From Change канала EuroPython Conference
[EuroPython 2017 - Talk - 2017-07-14 - PythonAnywhere Room]
[Rimini, Italy]
So you've released a library! Now you need to maintain it. You want to add features, restructure the code, fix bugs, and maybe improve the library's usability. Your users just want their code to carry on working. That's okay!
This talk will cover techniques in both code and project management to allow you to keep your code moving forwards without breaking your users' code. It is aimed at developers with a little experience of writing libraries in Python, and will cover some intermediate subjects like function decorators and magic methods.
Refactoring in Python is a mixed bag - on the one hand you have powerful tools like the @property decorator, __dunder__ methods, and even metaclasses. On the other hand, because Python code has no concept of private or protected like some other languages, it can be difficult to know what your public interface even is.
I'll talk about how to identify your public interface, and make that clear to your users. I'll cover how to structure your tests so you know when you've broken your public interface. I'll discuss how to use some of Python's language features to trick your users into thinking your code hasn't changed at all (except for those brilliant new features you've just added!). And finally, I'll cover how you know it's time to break backwards compatibility and how to break it to your users.
License: This video is licensed under the CC BY-NC-SA 3.0 license: https://creativecommons.org/licenses/by-nc-sa/3.0/
Please see our speaker release agreement for details: https://ep2017.europython.eu/en/speaker-release-agreement/
Видео Mark Smith - Pythonic Refactoring: Protecting Your Users From Change канала EuroPython Conference
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Anna Wszeborowska - Music transcription with PythonFelix Wick/Florian Wilhelm - How to Setup a new Python ProjectRuud van der Ham - Simulation of logistic systems in Python with salabimProtocol specifications written in pythonStephan Jaensch - Building mobile APIs with services at YelpPeter Sperl - Configuring uWSGI for Production: The defaults are all wrongSebastian Roll - The Dangers of Outsourcing Software DevelopmentFergal Walsh - Rethinking how we build HTTP APIsMoshe Goldstein/david dayan - Implementing Parallel Programming Design Patterns using EFL for PythonMika Boström, Alexander Schmolck - Marge: A bot for better Git'ingPeter Hoffmann - PySpark - Data processing in Python on top of Apache Spark.Olivier Grisel - Histogram-based Gradient Boosting in scikit-learn 0.21Olga Lyashevska - How can machine learning help to predict changes in size of Atlantic herring ?Marko Samastur - Publish your code so others can use it in 5 easy stepsAnna Veronika Dorogush - CatBoost - the new generation of Gradient BoostingRaúl Cumplido - Metaprogramación en PythonSarah Bird - The Web is Terrifying! Using the PyData stack to spy on the spiesMiloslav Pojman - HTTP/3 – Why should I care?Bruno Paixão - Digital Transformation in the fight against CoronavirusA. Molina -Web Applications on Python3 and Python2 with TurboGears Part 1Max Humber - How to read (code)