Python 版本 3.7 中是否存在 Isinstance?
Does Isinstance Exist in Python Version 3.7?
我正在使用 Visual Studio 2019 来学习 python 培训课程,该课程是用 3.6.1 编写的,并且正在 Python 版本 3.7 中编写;然而,当我写 isinstance 时,它的颜色不会改变,而培训课程中的代码会改变。
Is isinstance just not considered to fit in a special category anymore, or was it removed in an update?
是的,它仍然存在
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.
没看到any indication in the docs有去掉这个功能的愿望
我正在使用 Visual Studio 2019 来学习 python 培训课程,该课程是用 3.6.1 编写的,并且正在 Python 版本 3.7 中编写;然而,当我写 isinstance 时,它的颜色不会改变,而培训课程中的代码会改变。
Is isinstance just not considered to fit in a special category anymore, or was it removed in an update?
是的,它仍然存在
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.
没看到any indication in the docs有去掉这个功能的愿望