Skip to content

Preserving existing annotations in stubgen #2106

Description

@JukkaL

If code has annotations, it would be nice if stubgen would preserve them instead of filtering them out. Example (input -> output):

from mod import Thing
import mod2

def f(x: Thing) -> int:
    mod2.do_stuff()
    # more implementation

->

from mod import Thing

def f(x: Thing) -> int: ...

Maybe we should also (optionally) run type inference so that we could output inferred types for module-level variables and attributes.

See also discussion in #1899.

Activity

  1. yoongu commented on Nov 5, 2016

    @yoongu

    It would be super helpful to us if this got implemented!

  2. ilevkivskyi commented on Sep 22, 2017

    @ilevkivskyi
    Member

    This is now implemented in #3169.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions