vendredi 7 avril 2017

Python what does if 'self.root' do?

For example:

def __init__(self):
    self._root = None

def get(self, key):
    if self._root:
        return self._root.get(key).value
    raise KeyError

What does this if self._root: return? self._root is not a boolean.

Aucun commentaire:

Enregistrer un commentaire