Re:The unknown features of Python's `operator` module
by xrisk on Sunday August 08, 2021 @12:26PM
(#28107872)
exhaust((file.close() for file in files)) works.
[ Parent
| on HN ]
Re:The unknown features of Python's `operator` module
by klyrs on Sunday August 08, 2021 @12:40PM
(#28108015)
Like I said, contrived example. Though, it's a specific example of a more general pattern where you have a bunch of objects that you need to send a message to. You might use this for event handling in the guts of a game engine.