In Python, exceptions are classes and cased as such. For example: OSError
.
However, there are some exceptions, such as those in the socket module, that are named in lower-case. For example: socket.timeout
, socket.error
.
Why is this?
According to the docs,
exception socket.error A deprecated alias of OSError.
Changed in version 3.3: Following PEP 3151, this class was made an alias of OSError.
while standard exception types live in the root namespace, they are visually distinguished by the fact that they use the CamelCase convention, while almost all other builtins use lowercase naming (except True, False, None, Ellipsis and NotImplemented)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With