Very simple
I have this:
for i in self.Abilities:
i.OnTimer(amount)
Can i have something like this instead?
map(Ability.OnTimer,self.Abilities,amount)
I want to use map with class functions but i can’t get it to work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use
functools.partialto provide arguments to a function before calling it:But do you really think this would be more readable? And mind that
mapis lazy in Python 3!