0

When i searched implementation of listen method in _socket.pyi i founded only this code with ellipsis:

class socket:
    # ... some another methods with ellipsis ...
    def listen(self, __backlog: int = ...) -> None: ...

I could not find a real implementation of listen(). What is this pattern when methods without explicit implementation are used in the main class of the module? What is the point of this approach?

Vyacheslav
  • 77
  • 10
  • 1
    I'm not sure what you are asking here - explanation what the ... mean - or where the real implementation is? The first is answered by the duplicate. The latter - see [socketmodule.c](https://github.com/python/cpython/blob/8b24d60f1b7725d526ea5b5d3904b72e8b41ae0d/Modules/socketmodule.c#L3560) – Steffen Ullrich Oct 23 '22 at 11:10
  • @SteffenUllrich understand how to work ellipsis, but i cant found real implementation of listen() method. Why used this pattern? – Vyacheslav Oct 23 '22 at 11:12
  • 2
    Modules with performance requirements are usually implemented in C language. You only view a [`.pyi`](https://stackoverflow.com/questions/41734836/what-does-i-represent-in-python-pyi-extension) file, which is used for type hints. – Mechanic Pig Oct 23 '22 at 11:25

0 Answers0