python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
function to decide which classification method to use with optional parameters - Python
My goal is to include a "mod_type" param that indicates the type of model to run, either a decision tree or knn, using kwargs to let the user pass in the optional keyword params "k"...
MelaniaCB
Votes: 0
Answers: 2
How to pass **kwargs as params to FastAPI endpoint?
I have a function generating a dict template. This function consists of several generators and requires one parameter (i.e., carrier) and has many optional parameters (keyword arguments - **kwargs).
d...
PetrSevcik
Votes: 0
Answers: 1
Making at least one of many parameters required in PowerShell
In PowerShell, I want to write a function, that accepts different options as parameters. It is OK, if it receives more than one parameter, but it has to receive at least one parameter. I want to enfor...

stackprotector
Votes: 0
Answers: 3
Why is a function with a required parameter assignable to a function type where the parameter is optional
Question
Simply put, I wonder why the following is valid:
type Func = (param?: string) => void;
const func: Func = (param: string) => {
return;
};
The problem
In practice, this becomes a pro...
Richard
Votes: 0
Answers: 0