If I have a script like:
class ClassA(object):
...
def methodA(...):
varA=...
def funcA(...):
...
varA=funA(...)
I mean I intend to write a small function inside a class method, which is only used inside this class method. Is this code style OK? I think it’s a little ugly. Is there alternate?
Beauty is in the eye of the beholder.
It is totally fine having a very “local” function nested inside another function – especially from the point of readability of code.
Others will argue with coding style and best practice.
It is your code and you must feel fine with your code in order to understand and read it later.
So if it is fine for you and your understanding of “nice” code, go ahead.