profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/matangover/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

matangover/dereverberate 14

An implementation of a sound dereverberation algorithm by Gilbert Soulodre

matangover/musicquery 5

A notation-based query language for symbolic music

matangover/MuseScore 3

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!

boblsturm/folkplagiarism 1

Code to detect plagiarism in folkrnn generated output

matangover/a-painter 0

🎨 Paint in VR in your browser.

matangover/abjad 0

Abjad is a Python API for Formalized Score Control

matangover/aio-s3 0

The asyncio client for Amazon S3

matangover/atom 0

The hackable text editor

matangover/azure-devops-docs 0

This repo is the home of the official Azure DevOps documentation for Microsoft. GitHub Issues filed in this repository should be for problems with the documentation.

matangover/azure-sdk-for-node 0

Azure SDK for Node.js

IssuesEvent

issue commentmatangover/mypy-vscode

mypy failed with error [Errno 61]Connection Refused

Thanks for reporting it. This is probably not an issue with this extension, but an issue with dmypy itself. Probably the daemon is getting stuck and cannot communicate anymore. I'll reopen this issue for now anyway so we can investigate it.

When this error happens again, please do the following:

  1. Post the mypy extension output (copy it from the VS Code Output panel).

  2. Post the dmypy log file, which is created in the workspace storage. You can find the path to the log file in the dmypy command shown in the Output panel, e.g. /path/to/dmypy [...] --log-file '<log-file-path>'

  3. Try to reproduce the problem manually from the terminal by running dmypy -- copy the dmypy command from the Output panel and run it from inside the workspace folder

coneybeare

comment created time in 13 hours

issue commentmicrosoft/pylance-release

Spurious error when overriding property with constant value in base class

I summarized the discussion in my last post, we haven't reached an agreement... If you want to close it as wontfix that's your choice but I personally was not convinced it is the right one.

matangover

comment created time in 20 hours

issue commentmicrosoft/pylance-release

Spurious error when overriding property with constant value in base class

@jakebailey is this closed as fixed or wontfix?

matangover

comment created time in 21 hours

issue openedmicrosoft/vscode-jupyter

Auto-import displayed and applied incorrectly in interactive window

<!-- Read the guidelines for filing an issue first.

https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md#filing-an-issue -->

Environment data

<!-- To find your version, you can either:

  • Open the VS Code extensions panel. Locate Pylance from the list of installed extensions. The version appears next to the name.

  • Select "View: Toggle Output" from the command palette (Ctrl+Shift+P on Windows/Linux, Command+Shift+P on macOS), then select "Python Language Server" in the dropdown on the right. Look for the line Pylance Language Server version X in the console. -->

  • Language Server version: 2021.9.1 (pyright e804f324)

  • OS and version: macOS 10.15.7

  • Python version: 3.9.6

Expected behaviour

Pylance should display auto-import completions in the interactive window and apply them correctly (probably it can be applied inside the current interactive prompt). Or if this auto-import is not supported in the interactive window, it shouldn't be shown.

Actual behaviour

  1. The description of an auto-import completion shows an error:

image

  1. When accepting the suggestion, nothing happens.

created time in 4 days

issue openedmicrosoft/pylance-release

Auto-import displayed and applied incorrectly in interactive window

<!-- Read the guidelines for filing an issue first.

https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md#filing-an-issue -->

Environment data

<!-- To find your version, you can either:

  • Open the VS Code extensions panel. Locate Pylance from the list of installed extensions. The version appears next to the name.

  • Select "View: Toggle Output" from the command palette (Ctrl+Shift+P on Windows/Linux, Command+Shift+P on macOS), then select "Python Language Server" in the dropdown on the right. Look for the line Pylance Language Server version X in the console. -->

  • Language Server version: 2021.9.1 (pyright e804f324)

  • OS and version: macOS 10.15.7

  • Python version: 3.9.6

Expected behaviour

Pylance should displays auto-import completions in interactive window and apply them correctly - in the interactive prompt. Or if this auto-import is not supported in the interactive window, it shouldn't be shown.

Actual behaviour

  1. The description of an auto-import completion shows an error:

image

  1. When accepting the suggestion, nothing happens.

created time in 6 days

PR opened salu133445/muspy

Fix loading FolderDataset with use_converted=True

I think this bug was erroneously introduced while refactoring in #64. Thanks for this great library.

+1 -1

0 comment

1 changed file

pr created time in 6 days

create barnchmatangover/muspy

branch : fix-use-converted

created branch time in 6 days

fork matangover/muspy

A toolkit for symbolic music generation

https://salu133445.github.io/muspy/

fork in 6 days

issue commentmatangover/mypy-vscode

Errors not appearing in UI

Thanks! I'll review your fix soon

sidharthv96

comment created time in 19 days

startedmusikalkemist/praudio

started time in 19 days

startedthorstenMueller/deep-learning-german-tts

started time in 22 days

startedPyTorchLightning/pytorch-lightning

started time in 24 days

PR opened microsoft/python-type-stubs

matplotlib Patch.__init__ accepts any arguments

Patch and its subclasses accept arguments to init. Add *args and **kwargs to suppress false positive errors when instantiating patches.

+1 -0

0 comment

1 changed file

pr created time in 25 days

push eventmatangover/python-type-stubs

Matan Gover

commit sha 0b8a86e0d992d8e5e3a56918e916b126f306458b

matplotlib Patch.__init__ accepts any arguments Patch and its subclasses accept arguments to __init__. Add *args and **kwargs to suppress false positive errors when instantiating patches.

view details

push time in 25 days

fork matangover/python-type-stubs

A set of type stubs for popular Python packages. These are works in progress from the Microsoft Python team and others, with the intent that they are contributed to typeshed or to the associated packages once sufficiently complete.

fork in 25 days

startedgoogle/visqol

started time in 25 days

issue openedmicrosoft/pylance-release

Non-imported modules not indexed even with "indexing" enabled, when no workspace folder is opened

Environment data

  • Language Server version: 2021.8.2 (pyright f462f5bb)
  • OS and version: macOS 10.15.7
  • Python version: 3.9

Expected behaviour

When indexing is enabled ("python.analysis.indexing": true), auto-import should suggest to import a module even if it had not previously been manually imported in the project. This works correctly when a workspace folder is opened - but doesn't work when a single file is opened (without any workspace folder).

Actual behaviour

To reproduce:

  • Create new empty VS Code window
  • Change the empty file's language mode to Python
  • Type sys
  • Expect to have an auto-import suggestion to "Add import sys", but actually get no suggestion
  • Only after you manually add (and then remove) "import sys", the suggestion to "Add import sys" will correctly show up.
  • This happens whether or not "python.analysis.indexing": true is in your settings

created time in 25 days

issue commentmicrosoft/pylance-release

Auto-import should suggest exact matches with higher priority

I can open a new issue for "issue 1 not fixed when single file is opened". For "issue 2 not fixed" this current issue should be reopened, since it is exactly that.

matangover

comment created time in 25 days

issue commentmicrosoft/pylance-release

Auto-import should suggest exact matches with higher priority

Thanks for the info. That's great! I confirm that adding this setting fixes issue 1 when having a workspace folder opened. However, it's still not fixed when only a single file is opened (i.e. having no workspace folder open).

Also, it doesn't fix issue 2: image

matangover

comment created time in 25 days

startedYatingMusic/compound-word-transformer

started time in a month

issue commentmicrosoft/pylance-release

Auto-import should suggest exact matches with higher priority

Also: image

The exact match shows up last instead of first.

matangover

comment created time in a month

issue commentmicrosoft/pylance-release

Auto-import should suggest exact matches with higher priority

This is still not fixed, can it be re-opened?

image

Here sys should be shown but since it hasn't been analyzed yet (hasn't been manually imported), the auto-import suggestion are only showing results from the os module (which has been manually imported).

Using latest version Pylance language server 2021.8.2 (pyright f462f5bb)

matangover

comment created time in a month

issue commentmicrosoft/pylance-release

Spurious error when overriding property with constant value in base class

I totally agree that useLibraryCodeForTypes and type checking don't go together. In any case, my report isn't specific to libraries, it's true for any code. It seems pointless to discuss it any further because as the PEP says there is not always a clear correct answer wrt inference. I gave an example where the current behavior leads to false positives. You didn't show an example where the current behavior is useful. Changing the behavior may cause backwards incompatibility.

matangover

comment created time in a month

startedbearpelican/musicautobot

started time in a month

startedAI-Guru/music-generation-research

started time in a month

issue commentmicrosoft/pylance-release

Spurious error when overriding property with constant value in base class

Which third-party library are you using? Is it properly typed? If not, I wouldn't recommend using the strictest diagnostic checks. These checks rely on complete and accurate types, and you're likely to see many false positives if you attempt to use them.

The library is untyped. I don't think disabling strict diagnostic checks is a good recommendation. The checks are really useful to me in other parts of my code. They are only problematic when combined with wrong type inference. If anything, I would disable pylance inference for this untyped library, or add an ignore comment for the specific misleading error. Enabling/disabling checks globally based on which library I'm using feels wrong.

Type inference heuristics involve many tradeoffs. We've found that in most cases, it's best to infer the narrowest type. This results in the most accurate type checking, and it eliminates a class of false positive errors.

Can you give an example of a false positive error eliminated in this case by inferring Literal? I cannot think of a use case where inferring Literal[1] gives any advantage. As shown in the PEP 586 excerpt you referred to yourself, it results in false positives. If anything, maybe a union of Literals could be usefully inferred.

If we were to change one of these heuristics at this point, it would be a breaking change

OK, you might agree with my points but choose not to implement them due to this difficulty. But you seem to not agree with my points anyway?

evidence that it would provide significant value

Eliminating false positives

matangover

comment created time in a month

startedAI-Guru/MMM-JSB

started time in a month

issue commentmicrosoft/pylance-release

Spurious error when overriding property with constant value in base class

Thanks for your reply. My use case is that I'm overriding a function from a base class that is in a third-party library, I do not control the annotations of that library. I do want reportIncompatibleMethodOverride on because it's useful for me in other cases. I still think inferring the literal here is wrong.

Regarding the guidance you referred to in PEP 586:

An alternative strategy that does maintain compatibility in every case would be to always assume expressions are not Literal types unless they are explicitly annotated otherwise. A type checker using this strategy would always infer that x is of type str in the first example above.

This guidance seems to generally support my suggestion of not inferring literal.

Also I notice that TypeScript does not infer literal - the following gives no error:

class Hi {
    foo() {
        return 1;
    }
}

class Hi2 extends Hi {
    foo() {
        return 2;
    }
}
matangover

comment created time in a month

issue openedmicrosoft/pylance-release

Spurious error when overriding property with constant value in base class

<!-- Read the guidelines for filing an issue first.

https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md#filing-an-issue -->

Environment data

<!-- To find your version, you can either:

  • Open the VS Code extensions panel. Locate Pylance from the list of installed extensions. The version appears next to the name.

  • Select "View: Toggle Output" from the command palette (Ctrl+Shift+P on Windows/Linux, Command+Shift+P on macOS), then select "Python Language Server" in the dropdown on the right. Look for the line Pylance Language Server version X in the console. -->

  • Language Server version: 2021.8.0

  • OS and version: macOS 10.15.7

  • Python version (& distribution if applicable, e.g. Anaconda): 3.7

Expected behaviour

No warning when overriding property with constant value.

Actual behaviour

Error:

"foo" incorrectly overrides property of same name in class "Base"
  Property method "fget" is incompatible
    Return type mismatch: base method returns type "Literal[1]", override returns type "Literal[2]"
      "Literal[2]" cannot be assigned to type "Literal[1]"

Code Snippet / Additional information

class Base:
    @property
    def foo(self):
        return 1

class Derived(Base):
    @property
    def foo(self): # Error here
        return 2

Discussion

This happens for method return types as well:

class Base3:
    def foo(self):
        return 1

class Derived3(Base3):
    def foo(self): # Error here
        return 2

But does not happen for attributes. E.g.:

class Base3:
    foo = 1

class Derived3(Base3):
    foo = 2 # No error. Inconsistency?

It feels inconsistent that int is inferred for Base3.foo but not for for Base.foo and Base2.foo. You could say that Base3.foo is mutable but then it seems Base.foo is also "mutable" in a sense (when overridden).

You might suggest to annotate foo -> int but in my opinion pyright could be smart enough to not warn, at least for the property, when types are inferred.

created time in a month