Veneer - TypeError: object() takes no parameters

I get the following error and not really sure why

Traceback (most recent call last):
  File "", line 70, in <module>
    edytta.sell_artwork(picasso, "$6M (USD)")
  File "", line 42, in sell_artwork
    new_listing = Listing(artwork, price, self)
TypeError: object() takes no parameters

My code is below

class Art:
  def __init__(self, artist, title, medium, year, owner):
    self.artist = artist
    self.title = title
    self.medium = medium
    self.year = year
    self.owner = owner
  def __repr__(self):
    return "{}. \"{}\". {}, {}. {}, {}.".format(self.artist, self.title, self.year, self.medium,, self.owner.location)

class Marketplace:
  def __init__(self):
    self.listings = []     
  def add_listing(self, new_listing):
  def remove_listing(self, old_listing):
  def show_listings(self):
    for listing in self.listings:
class Client:
  def __init__(self, name, location, is_museum): = name
    self.is_museum = is_museum
    if is_museum:
      self.location = location
      self.location = "Private Collection"
  def __repr__(self):
    print ("{}".format(
  def sell_artwork(self, artwork, price):
    if artwork.owner == self:
      new_listing = Listing(artwork, price, self)

class Listing:
  def __init(self, art, price, seller): = art
    self.price = price
    self.seller = seller 
  def __repr_():
    return "{}, {}".format(, self.price)
  # '%s, %s' % (, self.price)

edytta = Client("Edytta Halpirt", None, False)

moma = Client("The MOMA", "New York", True)

veneer = Marketplace()

    # return "#s. \"%s\". %s, %s." % (self.artist, self.title, self.year, self.medium)

picasso = Art("Picasso, Pablo",  "Girl with a Mandolin (Fanny Tellier)", "oil on canvas", 1910, edytta)

edytta.sell_artwork(picasso, "$6M (USD)")


Also, is using

 # return "#s. \"%s\". %s, %s." % (self.artist, self.title, self.year, self.medium)

better than using .format() ?

Hi there, welcome to the forums!

You have a typo in your Listing class… should be fairly obvious once you start looking. :slight_smile:

That’ll solve your immediate error.

1 Like

@thepitycoder Thank you so much!

Do you have any thoughts on the second part of the question?

About the string formatting?

I wouldn’t say I have a preference either way, tbh. I tend to default to using printf-style formatting, i.e.

  print("The value of the account is %0.02f" % balance)

but that’s probably more habit than anything else now.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.