[Tutor] Inherit from SyntaxError?

Albert-Jan Roskam sjeik_appie at hotmail.com
Sun Mar 19 05:30:03 EDT 2023


   Hi,
   I'm writing a parser using Beazly's PLY package. I defined a custom
   exception (actually, two: one for the lexer and one for the parser). They
   inherit from SyntaxError. Along with a few other exceptions (e.g.
   MemoryError), I've always regarded SyntaxError as "special". Are there any
   disadvantages to inheriting from SyntaxError? I could also inherit from
   ValueError.
   Thanks!
   Albert-Jan


More information about the Tutor mailing list