From 121655826a8d0fc4f0992fe0110165a620faeabf Mon Sep 17 00:00:00 2001 From: jfh Date: Sun, 12 Sep 2021 22:32:16 +0300 Subject: [PATCH] pyarg(any) implies positional_or_keyword --- vm/src/builtins/enumerate.rs | 1 - vm/src/builtins/genericalias.rs | 2 -- vm/src/builtins/int.rs | 4 ---- vm/src/builtins/make_module.rs | 6 ------ vm/src/builtins/memory.rs | 1 - vm/src/builtins/module.rs | 1 - vm/src/stdlib/bisect.rs | 2 -- vm/src/stdlib/codecs.rs | 1 - vm/src/stdlib/io.rs | 2 -- vm/src/stdlib/itertools.rs | 1 - vm/src/stdlib/nt.rs | 2 -- vm/src/stdlib/os.rs | 10 ---------- vm/src/stdlib/posix.rs | 7 ------- vm/src/stdlib/posix_compat.rs | 2 -- vm/src/stdlib/signal.rs | 1 - vm/src/stdlib/sre.rs | 4 ---- vm/src/stdlib/ssl.rs | 4 ---- vm/src/stdlib/winreg.rs | 2 -- 18 files changed, 53 deletions(-) diff --git a/vm/src/builtins/enumerate.rs b/vm/src/builtins/enumerate.rs index 6e0407d9a5..6de1e454e8 100644 --- a/vm/src/builtins/enumerate.rs +++ b/vm/src/builtins/enumerate.rs @@ -30,7 +30,6 @@ impl PyValue for PyEnumerate { #[derive(FromArgs)] pub struct EnumerateArgs { - #[pyarg(any)] iterable: PyObjectRef, #[pyarg(any, optional)] start: OptionalArg, diff --git a/vm/src/builtins/genericalias.rs b/vm/src/builtins/genericalias.rs index 27f5df50c1..9a8b463040 100644 --- a/vm/src/builtins/genericalias.rs +++ b/vm/src/builtins/genericalias.rs @@ -28,9 +28,7 @@ impl PyValue for PyGenericAlias { #[derive(FromArgs)] pub struct GenericAliasArgs { - #[pyarg(any)] origin: PyTypeRef, - #[pyarg(any)] arguments: PyObjectRef, } diff --git a/vm/src/builtins/int.rs b/vm/src/builtins/int.rs index e4fa788716..e344357a9c 100644 --- a/vm/src/builtins/int.rs +++ b/vm/src/builtins/int.rs @@ -762,9 +762,7 @@ pub struct IntOptions { #[derive(FromArgs)] struct IntFromByteArgs { - #[pyarg(any)] bytes: PyBytesInner, - #[pyarg(any)] byteorder: PyStrRef, #[pyarg(named, optional)] signed: OptionalArg, @@ -772,9 +770,7 @@ struct IntFromByteArgs { #[derive(FromArgs)] struct IntToByteArgs { - #[pyarg(any)] length: PyIntRef, - #[pyarg(any)] byteorder: PyStrRef, #[pyarg(named, optional)] signed: OptionalArg, diff --git a/vm/src/builtins/make_module.rs b/vm/src/builtins/make_module.rs index 4511b82e56..b052f66a67 100644 --- a/vm/src/builtins/make_module.rs +++ b/vm/src/builtins/make_module.rs @@ -96,11 +96,8 @@ mod decl { #[derive(FromArgs)] #[allow(dead_code)] struct CompileArgs { - #[pyarg(any)] source: PyObjectRef, - #[pyarg(any)] filename: PyStrRef, - #[pyarg(any)] mode: PyStrRef, #[pyarg(any, optional)] flags: OptionalArg, @@ -569,9 +566,7 @@ mod decl { #[derive(FromArgs)] struct PowArgs { - #[pyarg(any)] base: PyObjectRef, - #[pyarg(any)] exp: PyObjectRef, #[pyarg(any, optional, name = "mod")] modulus: Option, @@ -700,7 +695,6 @@ mod decl { #[derive(FromArgs)] pub struct RoundArgs { - #[pyarg(any)] number: PyObjectRef, #[pyarg(any, optional)] ndigits: OptionalOption, diff --git a/vm/src/builtins/memory.rs b/vm/src/builtins/memory.rs index 7efa3c8c28..4e3f23218d 100644 --- a/vm/src/builtins/memory.rs +++ b/vm/src/builtins/memory.rs @@ -24,7 +24,6 @@ use std::ops::Deref; #[derive(FromArgs)] pub struct PyMemoryViewNewArgs { - #[pyarg(any)] object: PyObjectRef, } diff --git a/vm/src/builtins/module.rs b/vm/src/builtins/module.rs index da09e2749f..fc6e8a8bc5 100644 --- a/vm/src/builtins/module.rs +++ b/vm/src/builtins/module.rs @@ -39,7 +39,6 @@ pub fn init_module_dict( #[derive(FromArgs)] struct ModuleInitArgs { - #[pyarg(any)] name: PyStrRef, #[pyarg(any, default)] doc: Option, diff --git a/vm/src/stdlib/bisect.rs b/vm/src/stdlib/bisect.rs index 38b64e08d0..dd03199186 100644 --- a/vm/src/stdlib/bisect.rs +++ b/vm/src/stdlib/bisect.rs @@ -11,9 +11,7 @@ mod _bisect { #[derive(FromArgs)] struct BisectArgs { - #[pyarg(any)] a: PyObjectRef, - #[pyarg(any)] x: PyObjectRef, #[pyarg(any, optional)] lo: OptionalArg, diff --git a/vm/src/stdlib/codecs.rs b/vm/src/stdlib/codecs.rs index ac63e4e1d4..e3eee2ed7f 100644 --- a/vm/src/stdlib/codecs.rs +++ b/vm/src/stdlib/codecs.rs @@ -28,7 +28,6 @@ mod _codecs { #[derive(FromArgs)] struct CodeArgs { - #[pyarg(any)] obj: PyObjectRef, #[pyarg(any, optional)] encoding: Option, diff --git a/vm/src/stdlib/io.rs b/vm/src/stdlib/io.rs index 54ac8050e7..2e61e0b63f 100644 --- a/vm/src/stdlib/io.rs +++ b/vm/src/stdlib/io.rs @@ -1833,7 +1833,6 @@ mod _io { #[derive(FromArgs)] struct TextIOWrapperArgs { - #[pyarg(any)] buffer: PyObjectRef, #[pyarg(any, default)] encoding: Option, @@ -3455,7 +3454,6 @@ mod _io { #[derive(FromArgs)] struct IoOpenArgs { - #[pyarg(any)] file: PyObjectRef, #[pyarg(any, optional)] mode: OptionalArg, diff --git a/vm/src/stdlib/itertools.rs b/vm/src/stdlib/itertools.rs index ce580d7178..b1aa3c3241 100644 --- a/vm/src/stdlib/itertools.rs +++ b/vm/src/stdlib/itertools.rs @@ -260,7 +260,6 @@ mod decl { #[derive(FromArgs)] struct PyRepeatNewArgs { - #[pyarg(any)] object: PyObjectRef, #[pyarg(any, optional)] times: OptionalArg, diff --git a/vm/src/stdlib/nt.rs b/vm/src/stdlib/nt.rs index 9700c95932..c55a42f590 100644 --- a/vm/src/stdlib/nt.rs +++ b/vm/src/stdlib/nt.rs @@ -46,9 +46,7 @@ pub(crate) mod module { #[derive(FromArgs)] pub(super) struct SimlinkArgs { - #[pyarg(any)] src: PyPathLike, - #[pyarg(any)] dst: PyPathLike, #[pyarg(flatten)] target_is_directory: TargetIsDirectory, diff --git a/vm/src/stdlib/os.rs b/vm/src/stdlib/os.rs index 3d21b59fa9..fbb10a1432 100644 --- a/vm/src/stdlib/os.rs +++ b/vm/src/stdlib/os.rs @@ -427,9 +427,7 @@ pub(super) mod _os { #[cfg(any(unix, windows, target_os = "wasi"))] #[derive(FromArgs)] struct OpenArgs { - #[pyarg(any)] path: PyPathLike, - #[pyarg(any)] flags: i32, #[pyarg(any, default)] mode: Option, @@ -888,19 +886,12 @@ pub(super) mod _os { #[pyclass(module = "os", name = "stat_result")] #[derive(Debug, PyStructSequence, FromArgs)] struct StatResult { - #[pyarg(any)] pub st_mode: BigInt, - #[pyarg(any)] pub st_ino: BigInt, - #[pyarg(any)] pub st_dev: BigInt, - #[pyarg(any)] pub st_nlink: BigInt, - #[pyarg(any)] pub st_uid: BigInt, - #[pyarg(any)] pub st_gid: BigInt, - #[pyarg(any)] pub st_size: BigInt, // TODO: unnamed structsequence fields #[pyarg(positional, default)] @@ -1250,7 +1241,6 @@ pub(super) mod _os { #[derive(FromArgs)] struct UtimeArgs { - #[pyarg(any)] path: PyPathLike, #[pyarg(any, default)] times: Option, diff --git a/vm/src/stdlib/posix.rs b/vm/src/stdlib/posix.rs index b1927c7228..9054500677 100644 --- a/vm/src/stdlib/posix.rs +++ b/vm/src/stdlib/posix.rs @@ -291,9 +291,7 @@ pub mod module { #[derive(FromArgs)] pub(super) struct SimlinkArgs { - #[pyarg(any)] src: PyPathLike, - #[pyarg(any)] dst: PyPathLike, #[pyarg(flatten)] _target_is_directory: TargetIsDirectory, @@ -496,7 +494,6 @@ pub mod module { #[derive(FromArgs)] pub struct SchedParamArg { - #[pyarg(any)] sched_priority: PyObjectRef, } impl SlotConstructor for SchedParam { @@ -1689,13 +1686,9 @@ pub mod module { #[cfg(any(target_os = "linux", target_os = "macos"))] #[derive(FromArgs)] struct SendFileArgs { - #[pyarg(any)] out_fd: i32, - #[pyarg(any)] in_fd: i32, - #[pyarg(any)] offset: crate::crt_fd::Offset, - #[pyarg(any)] count: i64, #[cfg(target_os = "macos")] #[pyarg(any, optional)] diff --git a/vm/src/stdlib/posix_compat.rs b/vm/src/stdlib/posix_compat.rs index 7b6ec9871e..0cde380c7c 100644 --- a/vm/src/stdlib/posix_compat.rs +++ b/vm/src/stdlib/posix_compat.rs @@ -29,9 +29,7 @@ pub(crate) mod module { #[derive(FromArgs)] #[allow(unused)] pub(super) struct SimlinkArgs { - #[pyarg(any)] src: PyPathLike, - #[pyarg(any)] dst: PyPathLike, #[pyarg(flatten)] _target_is_directory: TargetIsDirectory, diff --git a/vm/src/stdlib/signal.rs b/vm/src/stdlib/signal.rs index 5a5f4e711c..0eff5d1584 100644 --- a/vm/src/stdlib/signal.rs +++ b/vm/src/stdlib/signal.rs @@ -175,7 +175,6 @@ pub(crate) mod _signal { #[derive(FromArgs)] struct SetWakeupFdArgs { - #[pyarg(any)] fd: WakeupFd, #[pyarg(named, default = "true")] warn_on_full_buffer: bool, diff --git a/vm/src/stdlib/sre.rs b/vm/src/stdlib/sre.rs index 6c4f8853ea..5c223bda34 100644 --- a/vm/src/stdlib/sre.rs +++ b/vm/src/stdlib/sre.rs @@ -92,7 +92,6 @@ mod _sre { #[derive(FromArgs)] struct StringArgs { - #[pyarg(any)] string: PyObjectRef, #[pyarg(any, default = "0")] pos: usize, @@ -102,10 +101,8 @@ mod _sre { #[derive(FromArgs)] struct SubArgs { - #[pyarg(any)] // repl: Either, repl: PyObjectRef, - #[pyarg(any)] string: PyObjectRef, #[pyarg(any, default = "0")] count: usize, @@ -113,7 +110,6 @@ mod _sre { #[derive(FromArgs)] struct SplitArgs { - #[pyarg(any)] string: PyObjectRef, #[pyarg(any, default = "0")] maxsplit: isize, diff --git a/vm/src/stdlib/ssl.rs b/vm/src/stdlib/ssl.rs index 0a196c11c4..5fc54e6036 100644 --- a/vm/src/stdlib/ssl.rs +++ b/vm/src/stdlib/ssl.rs @@ -180,7 +180,6 @@ fn _ssl_enum_certificates(store_name: PyStrRef, vm: &VirtualMachine) -> PyResult #[derive(FromArgs)] struct Txt2ObjArgs { - #[pyarg(any)] txt: PyStrRef, #[pyarg(any, default = "false")] name: bool, @@ -610,9 +609,7 @@ impl PySslContext { #[derive(FromArgs)] struct WrapSocketArgs { - #[pyarg(any)] sock: PyRef, - #[pyarg(any)] server_side: bool, #[pyarg(any, default)] server_hostname: Option, @@ -634,7 +631,6 @@ struct LoadVerifyLocationsArgs { #[derive(FromArgs)] struct LoadCertChainArgs { - #[pyarg(any)] certfile: PyPathLike, #[pyarg(any, optional)] keyfile: Option, diff --git a/vm/src/stdlib/winreg.rs b/vm/src/stdlib/winreg.rs index c855da042b..0535d88ef0 100644 --- a/vm/src/stdlib/winreg.rs +++ b/vm/src/stdlib/winreg.rs @@ -100,9 +100,7 @@ impl Hkey { #[derive(FromArgs)] struct OpenKeyArgs { - #[pyarg(any)] key: Hkey, - #[pyarg(any)] sub_key: Option, #[pyarg(any, default = "0")] reserved: i32,