def _txn_read_preference(self):
        """Return read preference of this transaction or None."""
        if self._in_transaction:
            return self._transaction.opts.read_preference
        return None
Return read preference of this transaction or None.
stackoverflow/venv/lib/python3.6/site-packages/pymongo/client_session.py