I am getting the error as shown in the question, and I can't figure out why. Even when trying other Stack Overflow methods of fixing this it doesn't work.
class Item(object):
def __init__(self, name, style, quantity):
self.name = name
self.style = style
self.quantity = quantity
class Weapon(Item):
def __init__(self, name, style, quantity=1):
Item.__init__(name, style, quantity,)
Bow = Weapon(name = "Bow", style = "WRanged", quantity = 1)
The lines affected with the error codes:
Traceback (most recent call last):
File "C:\Stuff\SG\Work\Inventory.py", line 33, in <module>
Bow = Weapon(name = "Bow", style = "WRanged", quantity = 1)
File "C:\Stuff\SG\Work\Inventory.py", line 12, in __init__
Item.__init__(name, style, quantity,)
TypeError: __init__() missing 1 required positional argument: 'quantity'