Because of the redefinition of ControlModel and SolveHandle (and therefore the ambigouity between clorm and clingo) for type-checkers like mypy or pyright it wasn't possible to handle them properly f.i. they weren't aware of the additional added methods like add_facts or the extra argument unifier of Control.__init__.
To solve this problem without introduce breaking changes, we move the redefinitions into a separate file clorm._clingo.py and export the classes in clorm.clingo.py twice, once with the name how they are defined in clingo and once with the original name.
In this way users how want to use type-checkers can import f.i. ClormControl whereas users how don't use type-checkers or can't change the name can still use Control (which is also a ClormControl class)
Because of the redefinition of
Control
Model
andSolveHandle
(and therefore the ambigouity between clorm and clingo) for type-checkers like mypy or pyright it wasn't possible to handle them properly f.i. they weren't aware of the additional added methods likeadd_facts
or the extra argumentunifier
ofControl.__init__
.To solve this problem without introduce breaking changes, we move the redefinitions into a separate file
clorm._clingo.py
and export the classes inclorm.clingo.py
twice, once with the name how they are defined in clingo and once with the original name.In this way users how want to use type-checkers can import f.i. ClormControl whereas users how don't use type-checkers or can't change the name can still use Control (which is also a ClormControl class)