Switching Branch without commit in working directory

Screen Link: https://app.dataquest.io/m/120/git-branches/2/switching-branches

My Code:

home/dq/chatbot$ git branch
  master
* more-speech
/home/dq/chatbot$ printf "\nprint('Kind of dull in here, right?')" >> bot.py
/home/dq/chatbot$ git status
On branch more-speech
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   bot.py

no changes added to commit (use "git add" and/or "git commit -a")

What I expected to happen:
As per the last paragraph on screen I should not be able to switch branch from more-speech to master because there is an uncommitted change in working directory.

The git checkout command allows us to switch branches. If we still have changes in the working directory we haven’t committed yet, though, Git will check whether there’s a potential merge conflict with the branch we’re switching to. If there is, Git won’t let us change branches.

What actually happened:
I am able to switch to the master branch even though the more-speech branch has uncommitted changes.

/home/dq/chatbot$ git checkout master
M       bot.py
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

From what I read it should allow you to change branches @vinayak.naik87. Git merge conflicts occur when totally different messages/codes are written on different branches on the same file and there is an attempt to merge the feature branch (in this case more-speech) with master. Here is the documentation for your reference.

In this case since the feature branch has changes the master branch is lagging behind, changes made can be merged in without conflict. But in the example in the documentation, changes are made to the same file different branches concurrently so there will be a conflict. Hope this clarifies!