MCPcopy Index your code
hub / github.com/python/cpython / dup

Method dup

Lib/socket.py:281–290  ·  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

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

Callers

nothing calls this directly

Calls 4

filenoMethod · 0.45
__class__Method · 0.45
settimeoutMethod · 0.45
gettimeoutMethod · 0.45

Tested by

no test coverage detected