Skip to content

Not able to locate member from parent class, apparently #14

Closed

Description

Hi, just created a pyrightconfig.json and started experimenting more with pyright against the project I am currently working on. It did find a couple of real bugs already 🐛 thanks! But there are some that appear to be false positives.

One is this one where it complains about a missing member, which is defined in a parent class.

/home/kinow/Development/python/workspace/cylc/lib/cylc/loggingutil.py
  '_open' is not a known member of 'TimestampRotatingFileHandler' (141, 28)

However, the class TimestampRotatingFileHandler extends logging.FileHandler, which declares _open:

    def _open(self):
        """
        Open the current base file with the (original) mode and encoding.
        Return the resulting stream.
        """
        return open(self.baseFilename, self.mode, encoding=self.encoding)

Cheers
Bruno

Activity

  1. kinow commented on Mar 25, 2019

    @kinow
    ContributorAuthor

    And just confirming, this is from the output of pyright ran as an external tool in PyCharm:

    image

  2. kinow commented on Mar 25, 2019

    @kinow
    ContributorAuthor

    Oh, sorry, just realized that was a private method. I was reading it as open. Good warning! Closing.

  3. wearetvxq commented on Jul 15, 2019

    @wearetvxq

    can you tell me how to install pyright in pycham, thanks

  4. erictraut commented on Jul 15, 2019

    @erictraut
    Collaborator

    Pyright isn't compatible with pycharm. It's a VS Code extension. It also runs on the command line.

  5. added a commit that references this issue on Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions