-5

I am using Visual Studio 2019 to follow along with a python training course which was written in 3.6.1, and am writing in Python version 3.7; however, when I write isinstance, its color does not change, where as the code in the training course does.

Is isinstance just not considered to fit in a special category anymore, or was it removed in an update?

Frasher Gray
  • 222
  • 2
  • 14
  • 6
    If your run a small example about `isinstance`, you will find whether it exists. XD. – jizhihaoSAMA Jun 03 '20 at 15:44
  • 1
    Did you actually install [Python development tools](https://visualstudio.microsoft.com/vs/features/python/) with your Visual Studio? These are not installed by default. So I suspect you will not get any Python syntax highlighting without it. – Cory Kramer Jun 03 '20 at 15:45

1 Answers1

2

Yes it still exists

Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

>>> help(isinstance)
Help on built-in function isinstance in module builtins:

isinstance(obj, class_or_tuple, /)
    Return whether an object is an instance of a class or of a subclass thereof.

    A tuple, as in ``isinstance(x, (A, B, ...))``, may be given as the target to
    check against. This is equivalent to ``isinstance(x, A) or isinstance(x, B)
    or ...`` etc.

I have not seen any indication in the docs that there is a desire to remove this function.

Cory Kramer
  • 114,268
  • 16
  • 167
  • 218