-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fixed support for get_type #104
Conversation
@mitar Thanks for making PR! Would you drop a (small) note what this fixes? Given that Travis-tests don't run any more, did you check this passes tests? |
Where should the note go? Oh, why Travis does not run anymore? You disabled it? Or something else? |
I tested on py27, py36 and py38. I didn't test on pypy3, py34, py35. |
Okay, that sounds good. I would like it to work on 3.5 for one more release but I will check that out.
AFAIK they changed policy and are not available any more (for free). I think most projects use a github-actions-based alternative now but I don't have time to figure that out for pytypes in near future. So for now it relies on local tests at home.
Oh, just here in the discussion. The PR kind of lacks context as it doesn't refer to an issue. You didn't fix that line for its own sake I suppose. Does it fix or help with #103 ? |
I see. I will see if I can help with that. If it will help you get to fix issues in #103 sooner. :-)
No, it is unrelated to #103. I thought of filling an issue but then I realized the fix is so simple I just made the MR. I thought I explained it well enough:
So if |
Okay. Did you stumble over a concrete failure of |
Ah, I use that here. Primitives are like functions, so in most cases one passes values as hyper-parameters to other functions, so I do regular type checking, but you can also pass a function itself to another function, and you pass that as a class, not an instance, so I have to check that as subclass check. Slightly misusing things, but easiest to implement. |
Okay, I see. Thanks. I had forgotten and overlooked that |
I gave it another thought: Probably
If
Advantages:
|
I updated it based on your proposal. |
Thanks! |
We do not want to use
__class__
because thenget_type
is never called.