this post was submitted on 25 Jun 2025
25 points (90.3% liked)

Python

7243 readers
11 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS
 

This is a question for people more experienced with Python, but everybody feel free to answer if you feel like you can provide something decent to the discussion.

Also feel free to explain why you feel that way and your experiences with Python and the paradigms.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 11 points 1 day ago (1 children)

For me it depends on the use case. If I'm designing something with an interface for someone downstream to use, I'll usually define (data)classes even if I have a functional interface.

For data science/modeling/notebooks I usually wouldn't define classes.

I think it also depends on your team; if everyone else is a functional programmer and you're writing classes or vice versa, this will undoubtedly create frictions.

[–] [email protected] 1 points 1 day ago (1 children)

I use python for data sciences (kinda) and never write any classes or something object oriented, but given that dataframes are the bread and butter of everything I do, I guess I work in a object oriented workflow?

[–] [email protected] 1 points 1 day ago

Yeah that's a great point -- the dataframe is in a sense a class or object standardized for data analysis. Its flexibility (like being able to store arrays or dicts even) obviates the need in most cases for a user-written class.