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

Try to improve hybrid property #173

Closed
wants to merge 1 commit into from
Closed

Try to improve hybrid property #173

wants to merge 1 commit into from

Conversation

CaselIT
Copy link
Member

@CaselIT CaselIT commented Sep 1, 2021

This is a try of using the mikes provided code in hybrids but it does not work propertly. Can you take a look @zzzeek ?

Description

Fixes: #171

Checklist

This pull request is:

  • A documentation / typographical error fix
    • Good to go, no issue or tests are needed
  • A short code fix
    • please include the issue number, and create an issue if none exists, which
      must include a complete example of the issue. one line code fixes without an
      issue and demonstration will not be accepted.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests. one line code fixes without tests will not be accepted.
  • A new feature implementation
    • please include the issue number, and create an issue if none exists, which must
      include a complete example of how the feature would look.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests.

Have a nice day!

@CaselIT CaselIT requested a review from zzzeek September 1, 2021 21:31
@zzzeek
Copy link
Member

zzzeek commented Sep 1, 2021

it doesnt work, my other recipe must have relied upon the way sqlalchemy-stubs works. feel free to close if theres no other ideas

@CaselIT
Copy link
Member Author

CaselIT commented Sep 2, 2021

There is an issue also with the current version in master. Like if you try the master branch, with the example in hybrid.py you get this:

obj = SomeModel()
reveal_type(obj.hp)
note: Revealed type is "def (*Any, **Any) -> Any"

this is clearly not correct. I think this may be a mypy issue, since pylance (on vscode) does correctly infer the type (to any in master, to the correct return value with this branch)

I'm not sure if the plugin has something to with this tough. Edit: no, removing the plugin definition from setup.cfg does not seem to make any difference

@CaselIT
Copy link
Member Author

CaselIT commented Jan 4, 2023

closing since for v2 we went on another direction

@CaselIT CaselIT closed this Jan 4, 2023
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.

no implementation for hybrids available
2 participants