title: Custom double star operator for a class?
body: <p>How does one implement custom double star operator (<code>**</code>) for unpacking, similar to how <code>__iter__</code> works with single star operator (<code>*</code>)?</p>
  
  <p>For example:</p>
  
  <pre><code>class PlayerManager(object):
  
      def __init__(self, players=None):
          self.players = players or []
  
      # Made up method to support ** operator
      def __dict_iter__(self):
          for player in self.players:
              yield get_steamid(player), player
  
  def print_players(**players):
      print(players)
  
  player_manager = PlayerManager([list, of, players])
  print_players(**player_manager)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>{
      'STEAM_0:0:02201': &lt;Player object at 0x0000000000&gt;,
      'STEAM_0:0:10232': &lt;Player object at 0x0000000064&gt;,
      'STEAM_0:0:73602': &lt;Player object at 0x0000000128&gt;
  }
  </code></pre>