Daily Dose of Data Science
Subscribe
Sign in
Home
Archive
About
Object-Oriented Programming
New
Why Python Does Not Offer True OOP Encapsulation
Using access modifiers (public, protected, and private) is fundamental to encapsulation in OOP. Yet, Python, in some way, fails to deliver true…
Avi Chawla
Feb 24
3
Share this post
Why Python Does Not Offer True OOP Encapsulation
www.blog.dailydoseofds.com
Copy link
Twitter
Facebook
Email
Notes
How To Enable Function Overloading In Python
Python has no native support for function overloading. Yet, there's a quick solution to it. Function overloading (having multiple functions with the…
Avi Chawla
Feb 20
4
Share this post
How To Enable Function Overloading In Python
www.blog.dailydoseofds.com
Copy link
Twitter
Facebook
Email
Notes
Make Dot Notation More Powerful in Python
Dot notation offers a simple and elegant way to access and modify the attributes of an instance. Yet, it is a good programming practice to use the…
Avi Chawla
Jan 9
2
Share this post
Make Dot Notation More Powerful in Python
www.blog.dailydoseofds.com
Copy link
Twitter
Facebook
Email
Notes
What Are Class Methods and When To Use Them?
Class methods, as the name suggests, are bound to the class and not the instances of a class. They are especially useful for providing an alternative…
Avi Chawla
Dec 30, 2022
Share this post
What Are Class Methods and When To Use Them?
www.blog.dailydoseofds.com
Copy link
Twitter
Facebook
Email
Notes
Hide Attributes While Printing A Dataclass Object
By default, a dataclass prints all the attributes of an object declared during its initialization. But if you want to hide some specific attributes…
Avi Chawla
Dec 24, 2022
Share this post
Hide Attributes While Printing A Dataclass Object
www.blog.dailydoseofds.com
Copy link
Twitter
Facebook
Email
Notes
__Post_init__: Add Attributes To A Dataclass Object Post Initialization
After initializing a class object, we often create derived attributes from existing variables. To do this in dataclasses, you can use the…
Avi Chawla
Dec 19, 2022
Share this post
__Post_init__: Add Attributes To A Dataclass Object Post Initialization
www.blog.dailydoseofds.com
Copy link
Twitter
Facebook
Email
Notes
Make a Class Object Behave Like a Function
If you want to make a class object callable, i.e., behave like a function, you can do so by defining the __𝐜𝐚𝐥𝐥__ method. This method allows you to…
Avi Chawla
Dec 3, 2022
1
Share this post
Make a Class Object Behave Like a Function
www.blog.dailydoseofds.com
Copy link
Twitter
Facebook
Email
Notes
Use Slotted Class To Improve Your Python Code
If you want to fix the attributes a class can hold, consider defining it as a slotted class. While defining classes, __𝘀𝗹𝗼𝘁𝘀__ allows you to…
Avi Chawla
Nov 17, 2022
4
2
Share this post
Use Slotted Class To Improve Your Python Code
www.blog.dailydoseofds.com
Copy link
Twitter
Facebook
Email
Notes
This site requires JavaScript to run correctly. Please
turn on JavaScript
or unblock scripts