Are two variable length parameters of different types possible? [on hold]











up vote
-4
down vote

favorite












Here is some working code that would take two lists as arguments



def param(funcs,args):   

return([func(arg) for arg in args] for func in funcs])


#param([lambda x: x * 2,int],[3.7, 2.5, 9.9, 11.001])
#[[7.4, 5.0, 19.8, 22.002], [3, 2, 9, 11]]


How can I have the same result for a variable number of functions and floats without passing two lists to the param function?










share|improve this question









New contributor




user31953 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by яүυк, Gerrit0, hjpotter92, 200_success, Sᴀᴍ Onᴇᴌᴀ 15 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – яүυк, Gerrit0, hjpotter92, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 2




    Welcome here! Who is funcs? More, def param(*func,*args) isn't valid Python code. The code is broken => it'll probably be closed. Please add more context to your question and fix the code within it.
    – яүυк
    16 hours ago








  • 2




    The idea of multiple variable-length arguments doesn't even make sense: how would this function know where func ends and args begins? Furthermore, Code Review only reviews concrete working code, which this isn't. That said, if you have a particular working function that you think might benefit from a different parameter-passing design, feel free to post that for review, and we might be able to suggest a better way to do it.
    – 200_success
    15 hours ago










  • @200_success I thought there might be a way to let the "function know where func ends and args begins" , perhaps by specifying type?
    – user31953
    12 hours ago















up vote
-4
down vote

favorite












Here is some working code that would take two lists as arguments



def param(funcs,args):   

return([func(arg) for arg in args] for func in funcs])


#param([lambda x: x * 2,int],[3.7, 2.5, 9.9, 11.001])
#[[7.4, 5.0, 19.8, 22.002], [3, 2, 9, 11]]


How can I have the same result for a variable number of functions and floats without passing two lists to the param function?










share|improve this question









New contributor




user31953 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by яүυк, Gerrit0, hjpotter92, 200_success, Sᴀᴍ Onᴇᴌᴀ 15 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – яүυк, Gerrit0, hjpotter92, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 2




    Welcome here! Who is funcs? More, def param(*func,*args) isn't valid Python code. The code is broken => it'll probably be closed. Please add more context to your question and fix the code within it.
    – яүυк
    16 hours ago








  • 2




    The idea of multiple variable-length arguments doesn't even make sense: how would this function know where func ends and args begins? Furthermore, Code Review only reviews concrete working code, which this isn't. That said, if you have a particular working function that you think might benefit from a different parameter-passing design, feel free to post that for review, and we might be able to suggest a better way to do it.
    – 200_success
    15 hours ago










  • @200_success I thought there might be a way to let the "function know where func ends and args begins" , perhaps by specifying type?
    – user31953
    12 hours ago













up vote
-4
down vote

favorite









up vote
-4
down vote

favorite











Here is some working code that would take two lists as arguments



def param(funcs,args):   

return([func(arg) for arg in args] for func in funcs])


#param([lambda x: x * 2,int],[3.7, 2.5, 9.9, 11.001])
#[[7.4, 5.0, 19.8, 22.002], [3, 2, 9, 11]]


How can I have the same result for a variable number of functions and floats without passing two lists to the param function?










share|improve this question









New contributor




user31953 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Here is some working code that would take two lists as arguments



def param(funcs,args):   

return([func(arg) for arg in args] for func in funcs])


#param([lambda x: x * 2,int],[3.7, 2.5, 9.9, 11.001])
#[[7.4, 5.0, 19.8, 22.002], [3, 2, 9, 11]]


How can I have the same result for a variable number of functions and floats without passing two lists to the param function?







python-3.x functional-programming






share|improve this question









New contributor




user31953 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




user31953 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 12 hours ago





















New contributor




user31953 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 17 hours ago









user31953

11




11




New contributor




user31953 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





user31953 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






user31953 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as off-topic by яүυк, Gerrit0, hjpotter92, 200_success, Sᴀᴍ Onᴇᴌᴀ 15 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – яүυк, Gerrit0, hjpotter92, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by яүυк, Gerrit0, hjpotter92, 200_success, Sᴀᴍ Onᴇᴌᴀ 15 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – яүυк, Gerrit0, hjpotter92, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 2




    Welcome here! Who is funcs? More, def param(*func,*args) isn't valid Python code. The code is broken => it'll probably be closed. Please add more context to your question and fix the code within it.
    – яүυк
    16 hours ago








  • 2




    The idea of multiple variable-length arguments doesn't even make sense: how would this function know where func ends and args begins? Furthermore, Code Review only reviews concrete working code, which this isn't. That said, if you have a particular working function that you think might benefit from a different parameter-passing design, feel free to post that for review, and we might be able to suggest a better way to do it.
    – 200_success
    15 hours ago










  • @200_success I thought there might be a way to let the "function know where func ends and args begins" , perhaps by specifying type?
    – user31953
    12 hours ago














  • 2




    Welcome here! Who is funcs? More, def param(*func,*args) isn't valid Python code. The code is broken => it'll probably be closed. Please add more context to your question and fix the code within it.
    – яүυк
    16 hours ago








  • 2




    The idea of multiple variable-length arguments doesn't even make sense: how would this function know where func ends and args begins? Furthermore, Code Review only reviews concrete working code, which this isn't. That said, if you have a particular working function that you think might benefit from a different parameter-passing design, feel free to post that for review, and we might be able to suggest a better way to do it.
    – 200_success
    15 hours ago










  • @200_success I thought there might be a way to let the "function know where func ends and args begins" , perhaps by specifying type?
    – user31953
    12 hours ago








2




2




Welcome here! Who is funcs? More, def param(*func,*args) isn't valid Python code. The code is broken => it'll probably be closed. Please add more context to your question and fix the code within it.
– яүυк
16 hours ago






Welcome here! Who is funcs? More, def param(*func,*args) isn't valid Python code. The code is broken => it'll probably be closed. Please add more context to your question and fix the code within it.
– яүυк
16 hours ago






2




2




The idea of multiple variable-length arguments doesn't even make sense: how would this function know where func ends and args begins? Furthermore, Code Review only reviews concrete working code, which this isn't. That said, if you have a particular working function that you think might benefit from a different parameter-passing design, feel free to post that for review, and we might be able to suggest a better way to do it.
– 200_success
15 hours ago




The idea of multiple variable-length arguments doesn't even make sense: how would this function know where func ends and args begins? Furthermore, Code Review only reviews concrete working code, which this isn't. That said, if you have a particular working function that you think might benefit from a different parameter-passing design, feel free to post that for review, and we might be able to suggest a better way to do it.
– 200_success
15 hours ago












@200_success I thought there might be a way to let the "function know where func ends and args begins" , perhaps by specifying type?
– user31953
12 hours ago




@200_success I thought there might be a way to let the "function know where func ends and args begins" , perhaps by specifying type?
– user31953
12 hours ago















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Quarter-circle Tiles

build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

Mont Emei