The code is crystal clear: assert lexer in ('standard', ...) or issubclass(lexer, Lexer) But the type hint said that lexer must be an _instance_ of Lexer, not a subclass. This change fixes it to require a subclass of Lexer.tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.11.2