Returning value rather than object pointer in Tutorial

So have progressed to part 2 of the tutorial on models. Everything works except for adding the str() methods.
I’ve modified polls/model.py as directed so it now looks like this:

from django.db import models
from django.utils import timezone
import datetime

class Question(models.Model):
    question_text = models.CharField(max_length=200)
    pub_date = models.DateTimeField("date published")
    def __str__(self):                              #Note that when this published the underscores disappear
        return self.question_text
    def was_published_recently(self):
        return self.pub_date >= timezone.now() - datetime.timedelta(days=1)

class Choice(models.Model):
    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField(default=0)
    def __str__(self):
        return self.choice_text

However when I run

>>> Question.objects.all() I get
<QuerySet [<Question: Question object (1)>, <Question: Question object (2)>]>

(I’d added two questions to the data base earlier). I can see using Admin that they have the values I set.
Can you explain how the method is meant to work?

Note: When posting code here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted. (I’ve fixed your post for you.)

After making this code change, did you exit and restart the shell? (Changes to the source code are not picked up by the shell while it is running.)

I did exit the shell Ctrl - D and got back to the normal terminal prompt. However having just done it today on a different computer (I’m using Replit so I just need a browser) it worked fine!
My problem is I’m learning multiple things at a time as I’ve not used the Replit environment before so I may have missed something or it left something running in the background that I was not aware of. Going forward if I have an issue I’ll log in and out to see if its the environment (or my lack of understanding of it).
Thanks so much for your help and sorry I wasted your time.