From: Jeremy Thurgood Date: Sat, 17 May 2014 20:27:18 +0000 (+0200) Subject: *REAL* Python has no dict comprehensions. X-Git-Tag: 0.1~27 X-Git-Url: https://git.ctpug.org.za/?p=naja.git;a=commitdiff_plain;h=781b8371fa213e1a2c44f5ba58444a26c0a5c15e *REAL* Python has no dict comprehensions. --- diff --git a/naja/gameboard.py b/naja/gameboard.py index 689c3fd..66c6519 100644 --- a/naja/gameboard.py +++ b/naja/gameboard.py @@ -188,7 +188,7 @@ class GameBoard(object): # Find which cards are at their maximum and exclude them from # the choice list counts = {} - choices = {card['card_name']: card for card in cards} + choices = dict((card['card_name'], card) for card in cards) for pos, card in board_locations: if pos == position: # skip the card we're replacing if appropriate