r/PythonLearning • • Jun 26 '26 • Bravo 2

Showcase Day 15 Python Learning

class inheritage

- parents child or say mulit-inheritance use with super () when one class inheritance from one or more class

- multi-level inheritance where 2nd class in Heritage from 1st class ,3th inherited from 2nd & go on like family chain

solve some list comprehensive easy problem

122 Upvotes

25 comments sorted by

β€’

u/Sea-Ad7805 Jul 18 '26

Run this program in Memory Graph Web Debugger to see the program state change step by step.

4

u/Beginning-Fruit-1397 Jun 26 '26

Untyped and unecessary kwargs in signatures is the type of things to review that make me slowly but surely drift away from pythonΒ 

2

u/aashish_soni5 Jun 28 '26

can you explain in more briefly I'm just in beginning phase

1

u/Technox1192 Jun 29 '26

Honestly, I feel you. I really prefer typed but so far circumstances have forced me to use python.

That said, I just use Pylance/Pyright and its amazing. The existence of static type checkers like these allowed me to be more comfortable with untyped languages that I have unfortunately need to work with.

u/aashish_soni5 This early on, I recommend integrating Pyright into your Python dev environment! If I'm reading it right and you're using VSCode, just install the Pylance extension. I recommend getting used to python.analysis.typeCheckingMode to standard. It helps you understand your code a lot better and catch bugs before they even occur.

A very basic example would be the code block below. Pyright should be able to warn you in advance that the print would eventually raise an AttributeError because 1 is an int and it does not have the upper() method.

Good luck and have fun!

some_list = ["a", "b", 1]

for i in some_list:
  print(i.upper())

1

u/Cultural_Cry535 Jun 27 '26

You don't need to call super init in the parent classes, they are no inheriting from other classes. Super is used to call a method from a parent class

1

u/aashish_soni5 Jun 28 '26

but without super it's so attribute error

1

u/Ulug_coder Jun 28 '26

Is comments needed

1

u/aashish_soni5 Jun 28 '26

you know when learning from other some word get confusing so it's better to write your own understanding as comment and right now I am not reach that level that I do not need to look back 😭 Just think like my own reference note

3

u/SCD_minecraft Jun 27 '26

Why you call super().__init__? Object class defines barebone init, it is ment to be overwritten

1

u/Ulug_coder Jun 28 '26

Day 15?

1

u/Ulug_coder Jun 28 '26

How many hours are you studying in a day

1

u/backend_developer89 Jun 30 '26

All of these criticisms below have merit, however at your stage day 15, you are doing quite well.
When I was at your level I barely understood functional programming, I had no understanding of OOP.
It looks like you are starting to feel comfortable with OOP.
Keep up the good work. πŸ‘

0

u/[deleted] Jun 26 '26

[deleted]

2

u/Daddybidoof Jun 26 '26

Is this the only comment you can reply with?

2

u/Sea-Ad7805 Jun 26 '26

Yes, it allows for easy recognition so that people that are not interested can skip it.

8

u/[deleted] Jun 26 '26

[removed] β€” view removed comment

1

u/aashish_soni5 Jun 26 '26

note πŸ“, can you tell me why you think so ii can learn more

5

u/[deleted] Jun 26 '26

[removed] β€” view removed comment

1

u/aashish_soni5 Jun 26 '26

yes πŸ™‚β€β†•οΈ thankyou

3

u/[deleted] Jun 26 '26

[removed] β€” view removed comment

1

u/aashish_soni5 Jun 27 '26

code with Harry

2

u/[deleted] Jun 27 '26

[removed] β€” view removed comment

1

u/aashish_soni5 Jun 28 '26

just post tag & conversation no problem