def _read_preference_for(self, session):
        """Read only access to the read preference of this instance or session.
        """
        # Override this operation's read preference with the transaction's.
        if session:
            return session._txn_read_preference() or self.__read_preference
        return self.__read_preference
Read only access to the read preference of this instance or session.
        
stackoverflow/venv/lib/python3.6/site-packages/pymongo/common.py