class Classname(object), what sort of word is 'object' in Python?

前端 未结 4 907
攒了一身酷
攒了一身酷 2020-12-14 06:18

When I create a module with its sole content:

class Classname(randomobject):
    pass

And I try to run the .py file of the module the inter

4条回答
  •  心在旅途
    2020-12-14 06:39

    object is an identifier that refers to a builtin type.

    Unlike many other languages, there are no primitive types in Python. Everything is an object, including all data types.

    I'm not sure why you expected inheriting from randomobject to work.

提交回复
热议问题