simplistix / sybil

Automated testing for the examples in your documentation.
https://sybil.readthedocs.io/en/latest/
Other
69 stars 14 forks source link

Fix type issues on sybil/parsers/abstract/codeblock.py #96

Closed adamtheturtle closed 11 months ago

adamtheturtle commented 11 months ago

This avoids the following issues.

sybil/parsers/abstract/codeblock.py:36: error: Cannot assign to a method  [method-assign]
sybil/parsers/abstract/codeblock.py:36: error: Incompatible types in assignment (expression has type "Callable[[Example], str | None]", variable has type "Callable[[Arg(Example, 'example')], str | None]")  [assignment]

I appreciate that the previous code works. I'm open to specific suggestions - e.g. to ignore all method-assign errors.

cjw296 commented 11 months ago

Fixed this is in https://github.com/simplistix/sybil/commit/205b8e4ae09c270db36b150dfd3cafe6e3d7c86f. I'd prefer to keep evaluate as a proper abstract method.