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

pytype generates invalid pyi #4

Closed
matthiaskramm opened this issue Jan 21, 2016 · 5 comments
Closed

pytype generates invalid pyi #4

matthiaskramm opened this issue Jan 21, 2016 · 5 comments

Comments

@matthiaskramm
Copy link
Contributor

pytype doesn't generate valid Python code for pyi. E.g. it generates

def f() -> None

instead of

def f() -> None: ...

.

Also, it uses ? for Any, omits certain imports, and uses x or y instead of Union[x, y].

@gvanrossum
Copy link

Also, sometimes it emits two function definitions for one in the input. E.g. input:

def bar(x):
    return x+1
bar(0)

and output:

def bar(x: int) -> int
def bar(x: bool or complex or float or int or long) -> bool or complex or float or int or long

(Let me know if you'd rather see me file a separate issue for that.)

@matthiaskramm
Copy link
Contributor Author

Yep, that should be a seperate issue. I'll move it over.

@matthiaskramm
Copy link
Contributor Author

Also see #12

@gvanrossum
Copy link

And #9.

On Thu, Jan 21, 2016 at 6:31 PM, Matthias Kramm notifications@github.com
wrote:

Also see #12 #12


Reply to this email directly or view it on GitHub
#4 (comment).

--Guido van Rossum (python.org/~guido)

@matthiaskramm
Copy link
Contributor Author

Fixed except for import issue, which I moved to #13 .

rchen152 added a commit that referenced this issue Aug 3, 2021
Who knew there were so many different ways to arrange three for loops?

PiperOrigin-RevId: 387919695
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

No branches or pull requests

2 participants