Instead, it is recommended that you transition to using ‘python3’ from within Terminal.

$ brew update && brew upgrade python 

Here is what the above code is Doing:
1. brew update updates Homebrew’s package index.
2. brew upgrade python upgrades Python to the latest version.
3. brew doctor checks your system for potential issues.
4. brew cleanup removes old versions of installed formulae.
5. brew cask cleanup removes old versions of installed casks.
6. brew prune removes dead symlinks from Homebrew’s prefix.
7. brew update-reset resets Homebrew’s update.
8. brew update-reset-prune resets Homebrew’s update and prune.
9. brew doctor-reset resets Homebrew’s doctor.
10. brew cleanup-reset resets Homebrew’s cleanup.
11. brew cask cleanup-reset resets Homebrew’s cask cleanup.