Skip to content

Multiple incompatibilities for the type of self #638

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

Closed
elazarg opened this issue Oct 29, 2016 · 1 comment
Closed

Multiple incompatibilities for the type of self #638

elazarg opened this issue Oct 29, 2016 · 1 comment

Comments

@elazarg
Copy link
Contributor

elazarg commented Oct 29, 2016

During my work (mypy/#2381) on a fix for mypy/#2374, I have encountered many bad signatures - mostly missing the self parameter - in the following methods (only a selection of them was chekced manually by me)

Python3

  1. stdlib/3/multiprocessing/managers.pyi:8: multiprocessing.managers.BaseManager.register
  2. stdlib/3/ssl.pyi:222: ssl.SSLContext.set_alpn_protocols
  3. stdlib/3/ssl.pyi:223: ssl.SSLContext.set_npn_protocols
  4. stdlib/3/ssl.pyi:234: ssl.SSLContext.wrap_bio
  5. stdlib/3/unittest.pyi:141: unittest.TestCase.addCleanup
  6. stdlib/3/urllib/request.pyi:120: urllib.request.HTTPPasswordMgrWithPriorAuth.update_authenticated
  7. stdlib/3/urllib/request.pyi:122: urllib.request.HTTPPasswordMgrWithPriorAuth.is_authenticated
  8. stdlib/3/urllib/request.pyi:194: urllib.request.URLopener.retrieve
  9. stdlib/3/urllib/request.pyi:77: urllib.request.BaseHandler.http_error_nnn
  10. stdlib/3/urllib/robotparser.pyi:9: urllib.robotparser.RobotFileParser.__init__

Python2:

  1. stdlib/2/imp.pyi:35: imp.NullImporter.find_module
  2. stdlib/2/select.pyi:97: select.epoll.unregister
  3. stdlib/2/select.pyi:98: select.epoll.poll
  4. stdlib/2/shlex.pyi:13: shlex.shlex.error_leader
  5. stdlib/2/ssl.pyi:172: ssl.SSLContext.set_alpn_protocols
  6. stdlib/2/ssl.pyi:173: ssl.SSLContext.set_npn_protocols
  7. stdlib/2/_struct.pyi:12: _struct.Struct.pack_into
  8. stdlib/2/_symtable.pyi:39: _symtable.symtable.__init__
  9. stdlib/2/tempfile.pyi:31: tempfile._RandomNameSequence.normcase
  10. stdlib/2/tempfile.pyi:45: tempfile._TemporaryFileWrapper.unlink
  11. The third overload of file.__init__:
    def __init__(file: int, mode: str = 'r', buffering: int = ...) -> None: ...

Also, tons of __builtin__ mismatches (possibly spurious).

Third party:

  1. third_party/3/pkg_resources.pyi:228: IMetadataProvider.*
  2. third_party/2/pymssql.pyi:21: pymssql.Cursor.callproc
@gvanrossum
Copy link
Member

Eew! So good to catch these. Can you submit fixes? One PR per subdirectory would be fone.

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

No branches or pull requests

2 participants