-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add basic stub for characteristic #771
Conversation
Did you get permission from the authors/developers of the package? See https://www.python.org/dev/peps/pep-0484/#the-typeshed-repo |
Permission granted and please look into using attrs instead. ;) |
OK, but what we have here is incomplete -- it only defines one method. @alexjurkiewicz Can you make it more complete? (Maybe run stubgen or just transcribe the major API elements by hand. |
Thanks @hynek -- I apologise for my lack of legacy rework :D I've added the remainder of the public API. How do you want the |
There is probably a way to make this definition tighter...
Thanks to @ilevkivskyi on Gitter
This looks fine, but could you reformat using 4-space indents? That aspect of PEP 8 still applies... :-) |
whoops!
whoops! |
@hynek, the irony of the @gvanrossum, doesn't the use of class decorators like
|
63ba0ab
to
7853c26
Compare
@@ -0,0 +1,34 @@ | |||
from typing import Sequence, Callable, Union, Any, Optional, AnyStr, TypeVar, Type | |||
|
|||
def with_repr(attrs: Sequence[Union[AnyStr,Attribute]]) -> Callable[..., Any]: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a space after the comma between AnyStr
and Attribute
(here and below).
@ambv -- I'm surprised flake8 didn't catch this?
Sadly that doesn't work yet: python/mypy#1551 |
There should be a space after the comma between AnyStr and Attribute (here and below).
@ambv -- I'm surprised flake8 didn't catch this?
Haha, this pull request predates flake8 integration. I only enabled it 3 days ago. Check it out locally and rebase, you'll see it fail the 'flake8' run.
|
I'll be able to work on this again in early Jan, apologies for the delay
…On Sat., 24 Dec. 2016, 8:48 am Łukasz Langa, ***@***.***> wrote:
> There should be a space after the comma between AnyStr and Attribute
(here and below).
>
> @ambv -- I'm surprised flake8 didn't catch this?
>
Haha, this pull request predates flake8 integration. I only enabled it 3
days ago. Check it out locally and rebase, you'll see it fail the 'flake8'
run.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#771 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAXKdbGRiS7D8th1obTAhfkkoGG1Yhmeks5rLGvogaJpZM4LNlSH>
.
|
Starting with python/mypy#2521 mypy is performing stricter function signature checks. This makes the stubs diverge from the actual implementation but makes the stubs internally consistent. Since this is an actual typing issue in the base implementation, we need to defer to the original authors to fix it. Sadly, in this case the breakage is rather fundamental and unlikely to get fixed by upstream. Consider: ``` class AWSAuthConnection(object): def make_request(self, method, path, headers=None, data='', host=None, auth_path=None, sender=None, override_num_retries=None, params=None, retry_handler=None): ... class AWSQueryConnection(AWSAuthConnection): def make_request(self, action, params=None, path='/', verb='GET'): ... ``` Hence, until we have a workaround for the error produced by Mypy, we're excluding those stubs from being tested against.
I had done exactly that, and it passed. Then I found that I didn't run I'm tempted to just fix the whitespace using GitHub's edit feature and merge. |
Thanks! If you want to change more, just submit a new PR. |
Thanks for your help and time!
…On Sat., 24 Dec. 2016, 11:12 am Guido van Rossum, ***@***.***> wrote:
Thanks! If you want to change more, just submit a new PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#771 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAXKdYHS0c8eJ9GVlm3EAZwXy20kY0Efks5rLI2TgaJpZM4LNlSH>
.
|
https://characteristic.readthedocs.io/en/stable/