pyupgrade icon indicating copy to clipboard operation
pyupgrade copied to clipboard

Remove inheriting from object when creating classes with type()

Open verhovsky opened this issue 4 years ago • 2 comments

Just as

class A(object): pass

is re-written as

class A: pass

, so should

A = type("A", (object,), {})

be re-written as

A = type("A", (), {})

See https://github.com/python/cpython/pull/19553

verhovsky avatar Sep 12 '21 20:09 verhovsky

I am going to attempt this one. @asottile could you assign me?

colin99d avatar Dec 22 '22 22:12 colin99d

I don't use the assign feature because if someone abandons working on it then it'll look like it's in progress forever and people will be discouraged from even attempting

asottile avatar Dec 22 '22 22:12 asottile