GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add typing to AFM parser by QuLogic · Pull Request #30134 · matplotlib/matplotlib Conversation
Member
PR summaryAlso, check some expected conditions at parse time instead of somewhere during use of the data. PR checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
QuLogic
commented
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm uncertain if
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
1 of 3 tasks
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
ksunden
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall looks good, aside from docstrings on the remade NamedTuples
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Comment on lines
+189
to
+194
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not include these comments as docstrings, which I think we would still prefer I think we should be able to do the
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, moved back to those.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least Sphinx picks up docstrings from the class body, but they have to be strings and not comments. While PEP 589 mentions that definitions can be "optionally preceded by a docstring" it seems that Sphinx uses the string following the definition.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Comment on lines
+286
to
+291
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as CharMetrics
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
QuLogic
force-pushed
the
afm-typing
branch
2 times, most recently
from
2896ae3 to
f506d95
Compare
jkseppan
reviewed
Uh oh!
There was an error while loading. Please reload this page.
jkseppan
reviewed
Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
Another option is to do something like def get_fontname(self) -> str: """Return the font name, e.g., 'Times-Roman'.""" if 'FontName' not in self._header: raise LookupError( 'Font name not found in AFM header. ' 'This may be due to an incomplete or malformed AFM file.' ) return self._header['FontName'] for all of the accesses. The if statement lets |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Should we discuss the overall direction regarding type hints? There was some discussion on Gitter but since there clearly are different opinions, I don't think we should decide this too hastily. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Also, check some expected conditions at parse time instead of somewhere during use of the data.
Add typing to AFM parser
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.