oop - Python method that can be called on a list of objects -


when method called on object in python as:

obj.func() 

then python passes obj first argument func(). want like:

[obj1, obj2].func()  

and have processed as:

[obj1.func(), obj.func()] 

is there way of defining kind of methods in python?

the way you're asking subclass python build-in class list.

this should help.

ps: bad thing though.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -