Is there a way to implement the ** operator on a custom object

Tony Flury tony.flury at btinternet.com
Thu Feb 8 07:21:20 EST 2024


I know that mappings by default support the ** operator, to unpack the 
mapping into key word arguments.

Has it been considered implementing a dunder method for the ** operator 
so you could unpack an object into a key word argument, and the 
developer could choose which keywords would be generated (or could even 
generate 'virtual' attributes).

-- 
Anthony Flury
email : anthony.flury at btinternet.com



More information about the Python-list mailing list