Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Within a module, we can shorten a.b.c.d... for readability #58

Open
FabriceSalvaire opened this issue Jan 27, 2024 · 0 comments
Open

Within a module, we can shorten a.b.c.d... for readability #58

FabriceSalvaire opened this issue Jan 27, 2024 · 0 comments

Comments

@FabriceSalvaire
Copy link

Tested it works, we just need to test the target is in the current module.

    def render_method(self, item: ItemData) -> t.Iterable[str]:
        """Create the content for a method."""
        short_name = item["full_name"].split(".")[-1]
        show_annotations = self.show_annotations(item)
        sig = f"{short_name}({self.format_args(item['args'], show_annotations, ignore_self='self')})"
        if show_annotations and item.get("return_annotation"):

            _ = f" -> {self.format_annotation(item['return_annotation'])}"
            _ = _.replace('PySpice.Unit.Unit.', '')
            sig += _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant