-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Classes created with collections.namedtuple carry no type annotations.
from collections import namedtuple
Function = namedtuple('Function', ['name', 'module_Path'])py2puml would generate the following documentation:
@startuml
class Function {
name: Any
module_path: Any
}
@endumlHowever, it is also possible to create named tuple classes with typing.NamedTuple and specify type annotations:
from typing import NamedTuple, Tuple
class Function(NamedTuple):
'''
Models a function (calling or being called):
- it has a name
- it is hosted in a module, modeled by its path as a tuple of strings
'''
name: str
module_path: Tuple[str]The expected PlantUML documentation would then be:
@startuml
class Function {
name: str
module_path: Tuple[str]
}
@endumlMetadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request