Python Forum

Full Version: Is a good practice naming user defined python functions with prefix udf_?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As we know, usually python user defined functions are named like get_record_count(), add_numbers(). But to make the functions easy to search and manage, especially when the functions are not in a dedicated py file, but with main logic in a single file, is it a good practice naming them with a prefix, like udf_get_record_count(), udf_add_numbers()?
Is it against PEP8?
Thank you!
(Mar-06-2024, 06:17 PM)meerkat Wrote: [ -> ]is it a good practice naming them with a prefix
I don't think it is pythonic. It is better to use qualified names, for example if udf is a submodule of your project, you can use udf.get_record_count(), udf.add_number() etc
I don't see any added benefit, just extra typing. all functions in the module are "user defined"