abulka/pynsource

Option to display arguments (and their types) for methods of classes

abulka opened this issue · 3 comments

Display arguments (and their types) to methods displayed in UML classes. Raised in #75.
E.g.

------------------------------
  Class Whatever
------------------------------
__init__(self, a: int, s: str)
doA(self)
doB(self, fred: Fred)
------------------------------

Probably want an option to turn this on and off, as it would add a lot more information to the UML diagram, which some users may not want. Perhaps an option to remove the self argument as it is always going to be there for regular methods of a class.

For class methods and static methods - some indicator showing this should be displayed.

Do you have any plans on when to implement these features (as well as the related ones created on July 25)? The typing annotations support since 1.77 is better, but the diagrams still lack clarity with these features missing.

Hi

I also would love this feature!
As an addition you can also make a feature to display class member variable types.

@pygamedev re displaying class member variable types, Pynsource already does this e.g.

class SomeType: pass

class Foo():
    foovar: SomeType = SomeType()
    def __init__(self, val):
        self.selfvar = val

print(Foo.foovar)
f = Foo(20)
print(f.selfvar)

generates

image

though admittedly having the type appear next to the class variable and/or on the association line would be nice too, which is probably what you mean. Thanks for the feedback.