All Questions
2 questions
1
vote
2
answers
2k
views
Python function name convention for "convert foo to bar", e.g., foo_to_bar, foo2bar
I have a function that converts args given by argparse to a filename:
def args2filename(args, prefix):
filename = prefix
kwargs = vars(args)
for key, value in sorted(kwargs.items()):
...
20
votes
2
answers
16k
views
How should I name functions that return values in Python?
I'm confused about choosing names for my functions in Python. Sometimes Python built-in functions are imperative such as: print function and string method find. Sometimes they aren't such as: len its ...