title: optional dictionary items in dict creation
body: <p>I have a function returning a dictionary:</p>
  
  <pre><code> def to_dict(self):
       return dict({'identification': self.identifier,
                    'information': self.information,
                    'nodes': {e.position: e.to_dict for e in self.children}
                    })
  </code></pre>
  
  <p>Is there a way to optionally add each k/v? This does not work e.g:</p>
  
  <pre><code>def to_dict(self):
           return dict({'identification': self.identifier,
                        'information': self.information,
                        'nodes': {e.position: e.to_dict for e in self.children} if self.children
                        })
  </code></pre>
  
  <p>Is there a way to add in optional parts of dict creation without having to build a separate dictionary for each variation; is there a better way to do this even ?</p>