pynsource icon indicating copy to clipboard operation
pynsource copied to clipboard

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

Open abulka opened this issue 5 years ago • 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.

abulka avatar Jul 25 '20 13:07 abulka

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.

MShekow avatar Oct 21 '20 16:10 MShekow

Hi

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

ghost avatar Jan 29 '22 02:01 ghost

@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.

abulka avatar Jan 31 '22 23:01 abulka