Reconciling pyqtProperty and mypy
me at the-compiler.org
Wed Aug 19 14:29:19 BST 2020
On Tue, Aug 18, 2020 at 02:54:14PM -0400, Ben Green wrote:
> I'm using pyqtProperty a lot, and mypy doesn't seem to play nicely with it.
> When defining the setter, it gives a "name already defined" error. Also,
> since the type is "Callable[..., Any]", instead of the actual type of the
> property, references to that property can give errors.
I dug into the mypy source code and it looks like there's quite some special
casing for properties:
Doesn't look like there's a way to customize it. Perhaps it'd be possible to
write a mypy plugin:
But I have no idea if it's possible at all.
On Wed, Aug 19, 2020 at 12:15:38PM +0300, Dmitri Bogomolov wrote:
> Shouldn't the second method have a different name?
Not for properties usually - see the examples:
me at the-compiler.org (Mail/XMPP) | https://www.qutebrowser.org
https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the PyQt