How to create an attribute that will be incremented each time the class is being inherited. Python

前端 未结 0 575
余生分开走
余生分开走 2020-12-20 00:20

I\'m looking for an answer how to increment superclass id attribute each time subclass(not object) is being created.

class Item:

    def __init__(self, id, n         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题