Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

self. is not required to access class variables inside the class #1231

@jakebailey

Description

@jakebailey

image

self. should be required to access the instance variable. This is likely happening because the variable is "in" the scope.

Notably, this isn't just a completion thing, and affects the analysis:

image

But the tooltip displayed is different in the self. case:

image

Also, for class variables:

val = 1234

class Foo:
    val = "str"

    def foo(self):
        print(val)


Foo().foo()

val in foo is 1234, not "str", but:

image

This also affects the completion list:

image

self.val is the right way to access the one in the class.

Metadata

Metadata

Labels

bugSomething isn't workingfeature: analysisgenfrom the generated tests

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions