Exceptional Exceptions

How to properly raise, handle and create them.

Mario Corchero

Best Practice Development General Python 3 Python Skills

See in schedule

Did you know there are multiple ways to raise and capture exceptions? Have you ever wondered if you should raise a built-in exception or create your own hierarchy? Did you ever find it hard to understand what an exception meant?
This talk will go through the decisions needed to raise and capture exceptions when creating a library. We will look at how to translate and handle errors, create your own exceptions, and make exceptions clear and easy to troubleshoot, while also understanding how they actually work, common pitfalls.

This talk will enable intermediate developers to leave the room with a solid understanding of how to work effectively with exceptions. As the exception flow usually goes untested, this will help prevent frustrating situations when errors occur that are not easy to understand or when an unexpected result is produced. The talk will delve into the different ways of working with exceptions. We will illustrate this with a real-world example to which many developers will be able to relate.

Following the talk, intermediate developers will leave the room more informed and better prepared to create and handle exceptions, having learned about many utilities that were already available to them, but were never used or were used improperly.

The not-so-advanced Pythonistas will get an in-depth dive into exceptions. Even if they might not be able to grasp all of the content, they will get a sense of the features that most programmers are unaware of and learn to use them when the proper situation arrives.

Advanced programmers will find this to be a humorous talk that will certainly teach them at least one new thing, as I will dive into parts of the grammar of Python that even many advanced programmers are not used to.

The talk is also full of niche information like why the variable that catches exceptions doesn’t like outside of the `except` scope.
The talk is comprised of four main sections preceded by an introduction to the problem and a conclusion with time for questions at the end. We will look at how to raise, capture, create and design exceptions, offering tips and pitfalls in each section.

Type: Talk (30 mins); Python level: Beginner; Domain level: Beginner


Mario Corchero

Bloomberg LP

Mario Corchero is a Senior Software Developer at Bloomberg. He leads the Python infrastructure team in London, enabling the company to work effectively in Python, building company-wide libraries and tools. His professional experience is mainly in Python and C++, and he has contributed some patches to multiple Python open source projects.
He is a PSF Fellow, received the Q3 2018 PSF Community Award, is vice president of the Python España (the Python Spain association) and has served as Chair of PyLondinium, PyConES17, and PyCon Charlas at Pycon 2018. Mario is passionate about the Python community, Open Source, and Inner Source.