@classmethod
def from_args(cls, executable=None, *args, is_windows: bool = False, raw_args: List[Any] = None, **kwargs):
"""
Custom factory to map *args to _args and **kwargs to _options
"""
return cls(
_executable=executable,
_options=kwargs, # capture **kwargs into dict
_args=list(args), # capture *args into list
is_windows=is_windows,
_raw_args=list(raw_args) if raw_args else []
)
Note: above new method is fake and need to add more details.