10
submitted 1 year ago by [email protected] to c/[email protected]

Constant modules are modules that often contains variables that you want to use in many places without relying on hard coded values. Sometime you store paths (often relatives).

Is it a good thing to use pathlib.Path() object is modules dedicated to constant?

Or is there anything that you should know before choosing to do so?

I would say the same question appears for using re.compile() in constants.

Any advise?

you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 3 points 1 year ago

I do that all the time.

this post was submitted on 20 Sep 2023
10 points (100.0% liked)

Python

6230 readers
40 users here now

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

📅 Events

October 2023

November 2023

PastJuly 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS