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

pyreverse missing dependency injection? #4585

Closed
csmotion opened this issue Jun 16, 2021 · 1 comment
Closed

pyreverse missing dependency injection? #4585

csmotion opened this issue Jun 16, 2021 · 1 comment
Labels
pyreverse Related to pyreverse component Question

Comments

@csmotion
Copy link

csmotion commented Jun 16, 2021

Question

If I do dependency injection for my class constructor, pyreverse misses linkages to those dependencies:

class SwervoControllerInterface:
    def __init__(
        self,
        globalsSingleton: GlobalsSingleton,
        waveformGenerator: WaveformGenerator,
        interfaceSCI: InterfaceSCI,
        systemIdentification: SystemIdentification,
    ):
        self.globs = globalsSingleton
        self.waveformGen = waveformGenerator
        self.interface = interfaceSCI
        self.sysID = systemIdentification

However, if I initialize in the constructor, pyreverse correctly adds the linkages:

class SwervoControllerInterface:
    def __init__(self):
        # Instantiate
        self.globs = GlobalsSingleton()
        self.waveformGen = WaveformGenerator()
        comm = pyMultiComm(
            self.globs.hostPort,
            self.globs.hostIP,
            self.globs.devicePort,
            self.globs.deviceIP,
        )
        self.interface = InterfaceSCI(self.globs, comm)
        self.sysID = SystemIdentification()

Is this the expected behavior, or am I missing a possible pyreverse config setting?

Thanks,
Jim

@Pierre-Sassoulas Pierre-Sassoulas added Question pyreverse Related to pyreverse component labels Jun 17, 2021
@Pierre-Sassoulas
Copy link
Member

It's probably expected behavior (in the sense that a feature is lacking) because pyreverse did not evolve much since typing became prevalent. (See #4551 for a possible evolution).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pyreverse Related to pyreverse component Question
Projects
None yet
Development

No branches or pull requests

2 participants