Python Forum
Super with Sublime Text - TypeError: super() takes at least 1 argument (0 given)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Super with Sublime Text - TypeError: super() takes at least 1 argument (0 given)
#1
Hi
I am trying to use the super function. I am getting the following message;

Error:
File "/Users/shaneshomefolder/Documents/Lists/numercial lists /inheratence_take_2.py", line 41, in __init__ super().__init__(make, model, backlight, battery, screentype) TypeError: super() takes at least 1 argument (0 given)
I am trying to follow a lesson online and am following the instructions exactly and continue to get this error. my code is
##30/04/19
##Shane Flanagan
##increment atrabutes through method

class Ereader():
	"""A class to represent an ereader"""

	def __init__ (self, make, model, backlight, battery, screentype):
		"""inatilase the atributes to represent an ererader"""
		self.make=make
		self.model=modle
		self.backlight=backlight
		self.battery=battery
		self.screentype=screentype 
		self.libararycount=0

	def get_ereader_name(self):
		"""return a formatted description for our ereader"""
		long_name = self.make + " - " + self.model + " - " +self.backlight + " - " + self.battery + "-" + self.screentype
		return long_name.title()

	def read_libarary_count(self):
		print("You Have " + str(self.libararycount) + " books in your libarary")


	def update_laibary_count(self, ebook_count):
		"""set the libary count"""
		self.libararycount=ebook_count

	def increment_libary_count(self, purchesed_ebooks):
		"""add new ebboks to libary count"""
		self.libararycount+=purchesed_ebooks

class KindleFire(Ereader):
	"""represents aspects of an ereader spicific to a kindle fire
		then initilaze atributes spicfic to a kindle fire"""
	def __init__(self, make, model, backlight, battery, screentype):
		"""initilize atributes of kindle fire"""
		

		super().__init__(make, model, backlight, battery, screentype)


my_kindle_fire = KindleFire('amazon', 'kindle fire', 'backlight', 'long life', 'color screen')
print(my_kindle_fire.get_ereader_name())
Reply


Messages In This Thread
Super with Sublime Text - TypeError: super() takes at least 1 argument (0 given) - by Shafla - May-04-2019, 07:40 PM
RE: Using the Super function - by Yoriz - May-04-2019, 07:47 PM
RE: Using the Super function - by Shafla - May-04-2019, 07:52 PM
RE: Using the Super function - by Yoriz - May-04-2019, 08:17 PM
RE: Using the Super function - by Shafla - May-04-2019, 08:23 PM
RE: Using the Super function - by Yoriz - May-04-2019, 08:25 PM
RE: Using the Super function - by Shafla - May-04-2019, 08:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [SOLVED] [newbie] Why call super()? When to use parent? Winfried 4 1,401 Feb-10-2025, 11:40 AM
Last Post: Winfried
Question TypeError: argument of type 'NoneType' is not iterable Tajaldeen 7 3,367 Nov-29-2024, 09:45 AM
Last Post: Tajaldeen
  Problems with super() Hoespilaar 3 2,233 Jun-11-2024, 02:15 AM
Last Post: kanetracy
  TypeError: Diagram.render() takes 1 positional argument but 2 were given sachin1361 0 1,348 Apr-23-2024, 06:39 AM
Last Post: sachin1361
  super() and order of running method in class inheritance akbarza 7 2,681 Feb-04-2024, 09:35 AM
Last Post: Gribouillis
  problem with print command in super() akbarza 5 1,995 Feb-01-2024, 12:25 PM
Last Post: deanhystad
  super() in class akbarza 1 2,744 Dec-19-2023, 12:55 PM
Last Post: menator01
  while loop not working-I am using sublime text editor mma_python 4 2,336 Feb-05-2023, 06:26 PM
Last Post: deanhystad
  Error TypeError: output_type_handler() takes 2 positional arguments but 6 were given paulo79 1 3,692 Oct-17-2022, 06:29 PM
Last Post: paulo79
  TypeError: float() argument must be a string or a number, not 'list' Anldra12 2 7,016 Jul-01-2022, 01:23 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020