I learn object-oriented programming in python 3. I've some exception, for example:
try:
self.result = (...)
except urllib.error.URLError as error:
print(error)
Generally all variables in classes are prefixed with self. Adding self before error variable:
try:
self.result = (...)
except urllib.error.URLError as self.error:
print(self.error)
causes:
SyntaxError: invalid syntax
Shall I just skip self before variables containing reason of exception?
selfis before trying to use it - understanding the concepts will make everything a lot easier, and it's not a hard thing once you understand it.