Skip to content

Switch-up strategy for ensuring dynamic vars end up in LSP#151

Merged
tychedelia merged 2 commits intoprocessing:mainfrom
tychedelia:bugfix/150-dynamic-vars-lsp
Apr 28, 2026
Merged

Switch-up strategy for ensuring dynamic vars end up in LSP#151
tychedelia merged 2 commits intoprocessing:mainfrom
tychedelia:bugfix/150-dynamic-vars-lsp

Conversation

@tychedelia
Copy link
Copy Markdown
Member

Our original goal was to support both:

from mewnala import *

print(width) # prints the default 100
import mewnala as mn

print(mn.width()) # more "honest" that this a runtime value, i.e. callable

Unfortunately, for stub generation and for LSP support, this is problematic as there isn't a good way to have an item that is both a variable and/or a function.

This PR changes our strategy -- everything is a variable/attribute. Having "magic" attr getters on a module seems to be a bit less Pythonic, but after all that's what properties are so it's fine, I think.

@tychedelia tychedelia merged commit a6a4dc5 into processing:main Apr 28, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

1 participant