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

Method is_socket

Lib/pathlib/__init__.py:940–947  ·  view source on GitHub ↗

Whether this path is a socket.

(self)

Source from the content-addressed store, hash-verified

938 return False
939
940 def is_socket(self):
941 """
942 Whether this path is a socket.
943 """
944 try:
945 return S_ISSOCK(self.stat().st_mode)
946 except (OSError, ValueError):
947 return False
948
949 def samefile(self, other_path):
950 """Return whether other_path is the same or not as this file

Callers 4

test_is_fifo_trueMethod · 0.80
test_is_socket_falseMethod · 0.80
test_is_socket_trueMethod · 0.80

Calls 2

statMethod · 0.95
S_ISSOCKFunction · 0.90

Tested by 4

test_is_fifo_trueMethod · 0.64
test_is_socket_falseMethod · 0.64
test_is_socket_trueMethod · 0.64