Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Include/internal/pycore_global_objects_fini_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Include/internal/pycore_global_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(argv)
STRUCT_FOR_ID(as_integer_ratio)
STRUCT_FOR_ID(asend)
STRUCT_FOR_ID(assoclen)
STRUCT_FOR_ID(ast)
STRUCT_FOR_ID(athrow)
STRUCT_FOR_ID(attr)
Expand Down Expand Up @@ -534,6 +535,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(headers)
STRUCT_FOR_ID(hi)
STRUCT_FOR_ID(hook)
STRUCT_FOR_ID(host)
STRUCT_FOR_ID(hour)
STRUCT_FOR_ID(hours)
STRUCT_FOR_ID(id)
Expand Down Expand Up @@ -582,6 +584,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(iter)
STRUCT_FOR_ID(iterable)
STRUCT_FOR_ID(iterations)
STRUCT_FOR_ID(iv)
STRUCT_FOR_ID(join)
STRUCT_FOR_ID(jump)
STRUCT_FOR_ID(keepends)
Expand Down Expand Up @@ -660,6 +663,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(namespace_separator)
STRUCT_FOR_ID(namespaces)
STRUCT_FOR_ID(native)
STRUCT_FOR_ID(nbytes)
STRUCT_FOR_ID(ndigits)
STRUCT_FOR_ID(nested)
STRUCT_FOR_ID(new_file_name)
Expand All @@ -684,6 +688,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(onceregistry)
STRUCT_FOR_ID(only_active_thread)
STRUCT_FOR_ID(only_keys)
STRUCT_FOR_ID(op)
STRUCT_FOR_ID(oparg)
STRUCT_FOR_ID(opcode)
STRUCT_FOR_ID(opcodes)
Expand Down Expand Up @@ -718,6 +723,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(pidfd)
STRUCT_FOR_ID(pointer_bits)
STRUCT_FOR_ID(policy)
STRUCT_FOR_ID(port)
STRUCT_FOR_ID(pos)
STRUCT_FOR_ID(pos1)
STRUCT_FOR_ID(pos2)
Expand Down
6 changes: 6 additions & 0 deletions Include/internal/pycore_runtime_init_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Include/internal/pycore_unicodeobject_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Lib/test/test_inspect/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -6312,6 +6312,25 @@ def test_signal_module_has_signatures(self):
import signal
self._test_module_has_signatures(signal)

def test_socket_module_has_signatures(self):
import socket
# The socket type has no signature, it is created by socket().
no_signature = {'SocketType'}
# The C default is NULL and None is not accepted
unsupported_signature = {'getservbyname', 'getservbyport'}
# Not all functions and methods are available on all platforms.
unsupported_signature &= vars(socket).keys()
# These cannot be converted to Argument Clinic: their behaviour
# depends on the number of the arguments.
methods_no_signature = {'ioctl', 'sendto', 'setsockopt'}
# These have parameters with unrepresentable default values.
methods_unsupported_signature = {'listen', 'sendmsg', 'sendmsg_afalg'}
defined = vars(socket.SocketType).keys()
self._test_module_has_signatures(socket,
no_signature, unsupported_signature,
{'SocketType': methods_no_signature & defined},
{'SocketType': methods_unsupported_signature & defined})

def test_stat_module_has_signatures(self):
import stat
self._test_module_has_signatures(stat)
Expand Down
Loading
Loading