Skip to content

Conversation

@exarkun
Copy link
Contributor

@exarkun exarkun commented Jun 2, 2022

No description provided.

exarkun and others added 28 commits May 5, 2022 15:31
I don't know what the deal with QThread is but it's more work to use than
Twisted's thread API and when you make a mistake, it SIGABRTs your whole
process instead of giving you an exception, so let's not use it if we don't
have to.
Without this, mypy (and/or pyqt5-stubs?) thinks ZKAPBarChartView's
inherited `chart()` method will always/only return a plain `QChart`
(and will throw an "attr-defined" error -- "'QChart' has no attribute
'update_chart'"). Using a custom getter here avoids this confusion:
`ZKAPBarChartView.get_chart` will always/only return a `ZKAPBarChart`.
As with the previous commit, using this custom/type-annotated getter
informs mypy that we are always/only expecting `View` to use a `Model`
(from gridsync/gui/model.py) for its model and not some other, broader
type that's missing the methods/attributes we want to type-check.
This avoids a TypeError from pynacl that disrupts key export.
@exarkun exarkun force-pushed the some-more-type-annotations.2 branch from b089dc3 to 1653f17 Compare June 8, 2022 11:34
@crwood crwood merged commit 624f11e into gridsync:master Jun 9, 2022
@exarkun exarkun deleted the some-more-type-annotations.2 branch June 16, 2022 15:15
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