Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Allow name and description arguments to elements to be positional #27

Open
1 task done
yt-ms opened this issue Sep 27, 2020 · 1 comment
Open
1 task done

Allow name and description arguments to elements to be positional #27

yt-ms opened this issue Sep 27, 2020 · 1 comment

Comments

@yt-ms
Copy link
Collaborator

yt-ms commented Sep 27, 2020

Checklist

Is your feature related to a problem? Please describe it.

When constructing a model from Python (rather than manipulating an existing one), it would be natural and more compact to be able to specify both the name and description of an element positionally rather than having to explicitly name them:

c1 = Container("Mobile app", "Application running on mobile devices")

See also #13

Describe the solution you would like.

class Container(StaticStructureElement):
    def __init__(
        self,
        name: str = "",
        desctription: str = "",
        *,
        parent: "SoftwareSystem" = None,
        technology: str = "",
        components: Iterable[Component] = (),
        **kwargs
    )
@Midnighter
Copy link
Owner

I guess it's a matter of style. I definitely prefer named keyword arguments for instantiation (makes it safer in my opinion). @ilaif prefers keyword arguments everywhere 😃

However, I don't need to force my style on others. So I'm not opposed to this change.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants