Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate and document info.py. #812

Draft
wants to merge 9 commits into
base: v1
Choose a base branch
from
Draft

Conversation

knutnergaard
Copy link
Contributor

No description provided.

@knutnergaard
Copy link
Contributor Author

@benkiel I ran into a few problems with this module:

  1. What are the available types for the value parameter in _validateFontInfoAttributeValue?
  2. Where are the magic methods in this class defined? mypy throws this error:
    info.py:107: error: "__hasattr__" undefined in superclass  [misc]
  3. What value types is BaseInfo.__setattr__ supposed to return? In my experience __setattr__ is supposed to return None, yet here, the method is treated as if returning something else.
  4. What is _getAttr supposed to return? mypy throws this error:
    info.py:113: error: "_getAttr" of "BaseInfo" does not return a value (it only ever returns None)  [func-returns-value]
  5. Isn't _fromMathInfo supposed to return anything? It's missing a return statement, yet its called in the return of the public equivalent. It also returns this mypy error:
    info.py:271: error: "_fromMathInfo" of "BaseInfo" does not return a value (it only ever returns None)  [func-returns-value]
  6. mypy throws the this error due to the differences in signature with the base method:
    info.py:230: error: Signature of "update" incompatible with supertype "DeprecatedBase"  [override]
    info.py:230: note:      Superclass:
    info.py:230: note:          def update(self) -> Any
    info.py:230: note:      Subclass:
    info.py:230: note:          def update(self, other: BaseInfo) -> None
    Not sure of the best way to deal with this.
  7. mypy also shows this error, (I think) due to BaseInfo not following the annotations.Interpolatable protocol:
    info.py:369: error: Value of type variable "InterpolatableType" of "interpolate" cannot be "BaseInfo"
    How should this be handled?

@benkiel
Copy link
Member

benkiel commented Dec 12, 2024

@knutnergaard, this is just a note that I've not forgotten this — I'm caught up in end-of-year things. I will get to it by the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants