Catch multiple exceptions in one line (except block)

I know that I can do:

I can also do this:

But if I want to do the same thing inside two different exceptions, the best I can think of right now is to do this:

Is […]

How do I pass a variable by reference?

The Python documentation seems unclear about whether parameters are passed by reference or value, and the following code produces the unchanged value ‘Original’

Is there something I can do to pass the variable by actual reference? Arguments are passed […]

What is the difference between @staticmethod and @classmethod in Python?

What is the difference between a function decorated with @staticmethod and one decorated with @classmethod? Maybe a bit of example code will help: Notice the difference in the call signatures of foo, class_foo and static_foo:

Below is the usual […]

How to make a chain of function decorators?

How can I make two decorators in Python that would do the following?

…which should return:

I’m not trying to make HTML this way in a real application – just trying to understand how decorators and decorator chaining […]