MCPcopy Index your code
hub / github.com/RustPython/RustPython / dup

Method dup

Lib/socket.py:280–289  ·  view source on GitHub ↗

dup() -> socket object Duplicate the socket. Return a new socket object connected to the same system resource. The new socket is non-inheritable.

(self)

Source from the content-addressed store, hash-verified

278 raise TypeError(f"cannot pickle {self.__class__.__name__!r} object")
279
280 def dup(self):
281 """dup() -> socket object
282
283 Duplicate the socket. Return a new socket object connected to the same
284 system resource. The new socket is non-inheritable.
285 """
286 fd = dup(self.fileno())
287 sock = self.__class__(self.family, self.type, self.proto, fileno=fd)
288 sock.settimeout(self.gettimeout())
289 return sock
290
291 def accept(self):
292 """accept() -> (socket object, address info)

Callers

nothing calls this directly

Calls 5

dupFunction · 0.50
filenoMethod · 0.45
__class__Method · 0.45
settimeoutMethod · 0.45
gettimeoutMethod · 0.45

Tested by

no test coverage detected