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

[Discussion] Different syntax for changing the repeat value #2

Open
KSneijders opened this issue Mar 22, 2023 · 3 comments
Open

[Discussion] Different syntax for changing the repeat value #2

KSneijders opened this issue Mar 22, 2023 · 3 comments
Labels
Help Needed Extra attention is needed Question Further information is requested

Comments

@KSneijders
Copy link
Contributor

KSneijders commented Mar 22, 2023

When conditionally updating the repeat value, it's done like the image below (from examples).
Unfortunately, because of the type hint of the attrs it is unable to understand what function is being called.

image


Maybe it could be changed in a way where (from example) BackgroundImage.info_header could be given to a function instead?
Might be from a global function or a static Retriever function. So:

set_retriever_repeat(BackgroundImage.info_header, instance, ...)
Retriever.set_repeat(BackgroundImage.info_header, instance, ...)

Love to know what you think!

@Divy1211
Copy link
Owner

Divy1211 commented Mar 23, 2023

Ooo, this is a good idea, you can already do this:

Retriever.set_repeat(BackgroundImage.info_header, instance, ...)

However, you'll get a typechecker error at the first argument instead of the function

@Divy1211
Copy link
Owner

Divy1211 commented Mar 23, 2023

This is something that needs to be further investigated because the type checker is supposed to understand how descriptors work and figure out when which type is being referred to, but I believe that there might be something missing in the Retriever syntax which causes the type to not be correctly deduced

@Divy1211 Divy1211 added Help Needed Extra attention is needed Question Further information is requested Enhancement New feature or request and removed Enhancement New feature or request labels Mar 23, 2023
@KSneijders
Copy link
Contributor Author

That sounds like a good temporary solution as you at least have the ability to jump to the function that way, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Needed Extra attention is needed Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants