@@ -70,22 +70,23 @@ protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFa
70
70
@ Builtin (name = "socket" , minNumOfPositionalArgs = 1 , maxNumOfPositionalArgs = 5 , keywordArguments = {"family" , "type" , "proto" , "fileno" }, constructsClass = PythonBuiltinClassType .PSocket )
71
71
@ GenerateNodeFactory
72
72
public abstract static class SocketNode extends PythonBuiltinNode {
73
- @ Specialization
74
- Object socket (PythonClass cls , @ SuppressWarnings ("unused" ) PNone family , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) PNone proto , @ SuppressWarnings ("unused" ) PNone fileno ) {
73
+ @ Specialization (guards = {"isNoValue(family)" , "isNoValue(type)" , "isNoValue(proto)" , "isNoValue(fileno)" })
74
+ Object socket (PythonClass cls , @ SuppressWarnings ("unused" ) PNone family , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) PNone proto ,
75
+ @ SuppressWarnings ("unused" ) PNone fileno ) {
75
76
return createSocketInternal (cls , PSocket .AF_INET , PSocket .SOCK_STREAM , 0 );
76
77
}
77
78
78
- @ Specialization
79
+ @ Specialization ( guards = { "isNoValue(type)" , "isNoValue(proto)" , "isNoValue(fileno)" })
79
80
Object socket (PythonClass cls , int family , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) PNone proto , @ SuppressWarnings ("unused" ) PNone fileno ) {
80
81
return createSocketInternal (cls , family , PSocket .SOCK_STREAM , 0 );
81
82
}
82
83
83
- @ Specialization
84
+ @ Specialization ( guards = { "isNoValue(proto)" , "isNoValue(fileno)" })
84
85
Object socket (PythonClass cls , int family , int type , @ SuppressWarnings ("unused" ) PNone proto , @ SuppressWarnings ("unused" ) PNone fileno ) {
85
86
return createSocketInternal (cls , family , type , 0 );
86
87
}
87
88
88
- @ Specialization
89
+ @ Specialization ( guards = { "isNoValue(fileno)" })
89
90
Object socket (PythonClass cls , int family , int type , int proto , @ SuppressWarnings ("unused" ) PNone fileno ) {
90
91
return createSocketInternal (cls , family , type , proto );
91
92
}
0 commit comments