Code Monkey home page Code Monkey logo

Comments (1)

thebjorn avatar thebjorn commented on July 17, 2024

If you look at what that type actually is (i.e. whatever the type of defaultdict(dict) is), it might not be very helpful. I'll even argue that the comment is much more informative ;-)

Calling the modulefinder code "somewhat esoteric" is a bit of an understatement :-) MyModuleFinder is a thin layer on top of the Python std library modulefinder module, that fixes a couple of bugs that only show up in our use cases. The _depgraph field is where modulefinder leaves its result for us to pick up (it's a nested dict of nested dicts of ...).

I like types, but Python's type system is horrendously anemic and excessively verbose, e.g. the typing of sum ought to be able to be expressed very similar to:

def sum(vals: iterator[T], start: T) -> T:  # an iterator producing something of type T, a start value of the same type, returning a value of that type
    x = start       # should never need to be typed, type inference should handle it
    for v in vals:  # ditto
        x += v
    return x

how many lines of type code do you need to write to get this to work in Python..?

I'll get off my soap-box now :-D

ps: PRs that add sensible typings (api interface boundaries) will likely be merged...

from pydeps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.