Daily Dose of Data Science

Share this post

Hide Attributes While Printing A Dataclass Object

www.blog.dailydoseofds.com

Hide Attributes While Printing A Dataclass Object

Avi Chawla
Dec 24, 2022
Share

By default, a dataclass prints all the attributes of an object declared during its initialization.

But if you want to hide some specific attributes, declare 𝐫𝐞𝐩𝐫=π…πšπ₯𝐬𝐞 in its field, as shown above.

Share this post on LinkedIn: Post Link.

Thanks for reading Daily Dose of Data Science! Subscribe for free to receive new posts and support my work.


Find the code for my tips here:Β GitHub.

I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn.

Share
Previous
Next
Comments
Top
New
Community

No posts

Ready for more?

Β© 2023 Avi Chawla
Privacy βˆ™ Terms βˆ™ Collection notice
Start WritingGet the app
SubstackΒ is the home for great writing