Skip to content

PyYaml: uncomment commented out imports and add missing classmethod decorators #1439

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

Merged
merged 3 commits into from
Jul 1, 2017
Merged

Conversation

rytilahti
Copy link
Contributor

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good apart from the Travis failure.

# from yaml.nodes import *
# from yaml.loader import *
# from yaml.dumper import *
from yaml.error import *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try from .error import * here (I haven't tested it though)

Copy link
Contributor Author

@rytilahti rytilahti Jun 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately that doesn't help, from the sound of it flake8 doesn't like wildcard imports. Other ideas?

edit: for example, F403 'from .error import *' used; unable to detect undefined names

@graingert
Copy link
Contributor

graingert commented Jun 27, 2017

@JelleZijlstra clearly flake8 should ignore from yaml.error import * in pyi files. Because with mypy you are by definition able "to detect undefined names"

@rytilahti
Copy link
Contributor Author

Added an ignore for those wildcards.

@rytilahti
Copy link
Contributor Author

rytilahti commented Jun 30, 2017

Shouldn't that be a separate PR, though?
edit: I can remove the noqa from this PR though, if that's the case.

@graingert
Copy link
Contributor

graingert commented Jun 30, 2017 via email

@JelleZijlstra
Copy link
Member

That's not necessarily correct; I'd still want to disallow from typing import * in stubs.

@JelleZijlstra JelleZijlstra merged commit 218ce96 into python:master Jul 1, 2017
rhysparry added a commit to rhysparry/typeshed that referenced this pull request Jul 3, 2017
* python/master:
  Added stub for toaiff module (python#1455)
  Added stub for user module (python#1454)
  Add more multiprocessing function stubs (python#1435)
  PyYaml: uncomment commented out imports and add missing classmethod decorators (python#1439)
  Allow `os.readlink` to accept path-like objects (python#1441)
  Support named attributes in `os.uname()` result (python#1445)
  Fix signature for slite3.fetchmany (python#1444)
  Add __name__ field to MethodType (python#1442)
  Add TypedDict total argument (python#1443)
@rytilahti
Copy link
Contributor Author

Thanks for the merge! I didn't notice it before and came here to see how to proceed :)

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.

3 participants