I am trying to create a module containing many little functions useful for linguistics. So far everything works right, but I have a question: is it a problem if a function within a module calls another function within the same module?

I mean, I have a function that performs a particular process and a second function that produces some kind of out put and then calls the first function to produce something different.

It's something like this:

function A takes a verb in english (to speak, for example) and removes the 'to'.

function B requires parameters for tense and verb, and according to user input it defines the ending to be attached to the verb. So function B receives ('to start', 'past') as parameters. Then it calls function A to remove the 'to' and then attaches the -ed to form 'started'.

It works great, but, is it OK to do have function be call function A (which is in the same module).

I hope it's clear enough

Thanks for your help

Edited by G_S: n/a

5 Years
Discussion Span
Last Post by G_S

Yes, python is extremely permissive. Any function can call any other function in any module, including the module where it is defined.

Edited by Gribouillis: n/a


Sorry for the incredibly late reply. Thanks for the answer.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.