You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this comment, I isolated an issue where mypy static analysis checks are failing on a foolscap Referenceable RemoteInterface. Given this minimal implementation:
# remote.py
from foolscap.api import RemoteInterface, Referenceable
from zope.interface import implementer
class RIBucketWriter(RemoteInterface):
""" Objects of this kind live on the server side. """
def write(offset=None, data=None):
return None
@implementer(RIBucketWriter)
class BucketWriter(Referenceable):
def remote_write(self, offset, data):
pass
Then, creating an environment with unmerged branches of mypy-zope and foolscap:
test $ python -m venv env
test $ env/bin/pip install -q mypy-zope@git+https://github.com/jaraco/mypy-zope@bugfix/21-InterfaceClass-subclass foolscap@git+https://github.com/jaraco/foolscap@bugfix/75-use-metaclass
Attempting to run mypy on that simple BucketWriter produces this error:
test $ env/bin/mypy remote.py
remote.py:18: error: 'BucketWriter' is missing following 'RIBucketWriter' interface members: write.
Found 1 error in 1 file (checked 1 source file)
It seems mypy is unaware of the contract that a Referenceable adds providing the required interface but with method names replaced with remote_prefixed.
Presumably the proper fix would be to add mypy support (plugin) for these Referenceable objects.
The text was updated successfully, but these errors were encountered:
In this comment, I isolated an issue where mypy static analysis checks are failing on a foolscap Referenceable RemoteInterface. Given this minimal implementation:
and this mypy configuration:
Then, creating an environment with unmerged branches of mypy-zope and foolscap:
Attempting to run mypy on that simple BucketWriter produces this error:
It seems mypy is unaware of the contract that a Referenceable adds providing the required interface but with method names replaced with
remote_
prefixed.Presumably the proper fix would be to add mypy support (plugin) for these Referenceable objects.
The text was updated successfully, but these errors were encountered: