typeshed VS black

Compare typeshed vs black and see what are their differences.

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
typeshed black
24 321
4,017 37,210
2.0% 3.1%
9.9 9.5
about 19 hours ago about 24 hours ago
Python Python
GNU General Public License v3.0 or later MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

typeshed

Posts with mentions or reviews of typeshed. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-02-26.
  • Ask HN: Will we see a TypeScript for Python?
    2 projects | news.ycombinator.com | 26 Feb 2023
    https://github.com/python/typeshed is Python's equivalent of DefinitelyTyped. I'm not 100% sure why it's not more of a popular thing the way DefinitelyTyped is; I think there might, to some extent, be different attitudes around the appropriateness of having third-party typings for packages, when the actual maintainer of the package isn't interested in providing first-party ones.
  • Why Type Hinting Sucks!
    7 projects | /r/Python | 10 Feb 2023
    https://github.com/python/mypy same with typeshed https://github.com/python/typeshed
  • When the client's management is happy but their dev team is a pain
    8 projects | /r/ProgrammerHumor | 31 Jan 2023
    Here's the tensorflow type stubs on typeshed. https://github.com/python/typeshed/tree/main/stubs/tensorflow
  • Ruby 3.2’s YJIT is Production-Ready
    8 projects | news.ycombinator.com | 17 Jan 2023
    Python's type hints are definitely an improvement and they're getting better all the time, but they're still frustrating to use at anything approaching the edge. I long for something as elegant and functional as TypeScript.

    One hurdle I've stumbled over recently is the question "what is a type?", the answer can be surprising. Unions, for example, are types but not `Type`s. A function that takes an argument of type `Type` will not accept a Union. So if you want to write a function that effectively "casts" a parameter to a specified type, you can't. The best you can do is have an overload that accepts `Type` and does an actual cast, and then another that just turns it into `Any`. This is, in fact, how the standard library types its `cast` function [1]. The argument I've seen for the current behavior is that `Type` describes anything that can be passed to isinstance, but that's not a satisfying answer. Even then, `Union` can be passed to isinstance and still does not work with `Type`. Talk currently is to introduce a new kind of type called `TypeForm` or something to address this, which is certainly an improvement over nothing, but still feels like technical debt.

    [1]: https://github.com/python/typeshed/blob/main/stdlib/typing.p...

  • GitHub stars won't pay your rent
    5 projects | news.ycombinator.com | 9 Nov 2022
    >Ultimately if you care enough about Fody to spend over a hundred dollars worth of your time contributing to it, you probably care enough about Fody to drop them three dollars.

    No, I really don't.

    https://github.com/keepassxreboot/keepassxc/pull/8500 - I was randomly reading keepassxc's manpage and spotted a curious option, spent some time spelunking through the code and history to discover that it was an outdated option, sent a PR.

    https://github.com/python/typeshed/pull/8617 - I converted one of the scripts I use in my DE from shell to Python, saw that VSCode has this new fancy typing support for Python, quickly found a basic bug in the type definitions for the os module, tested a fix locally, sent a PR.

    https://gitlab.gnome.org/GNOME/gtk/-/issues/5250 - I found an issue with copy-paste on my phone, investigated it all the way through to the GTK stack, found the commits that introduced the issue, created a distro patch for it while discussing it with GTK upstream.

    https://gitlab.alpinelinux.org/alpine/aports/-/merge_request... - I noticed that gnome-passwordsafe crashes some times, debugged it to discover that it was missing a dependency, sent a PR to the distro package to update the dependencies.

    etc etc. I've made lots of fixes like these. I have no interest in paying for each and every one of them. The projects are all better off for fixes like mine and gatekeeping them on payment would've been nothing but their loss.

  • Using Mypy in Production
    11 projects | news.ycombinator.com | 22 Aug 2022
    You have to do handling like that in other languages like TypeScript anyway.

    Painpoint with type annotations:

    - not being able to reuse "shapes" of data: TypedDict, NamedTuple, dataclasses.dataclass, and soon kwargs (PEP 692 [1]) all have named, typed fields now. You have to

    - Since there's no generic "shape" structure that works across data types, there isn't a way to load up a JSON / YAML / TOML into a dictionary, upcast it via a `TypedGuard`, and pass it into a TypedDict / NamedTuple / Dataclass. dataclasses.asdict() or dataclasses.astuple() return naive / untyped tuples and dicts. Also the factory functions will not work with TypedDict or NamedTuple, respectively, even if you duplicate the fields by hand. See my post here: https://github.com/python/typeshed/issues/8580

    - Standard library doesn't have runtime validation (e.g. pydantic / https://github.com/pydantic/pydantic).

    - pytest fixtures are hard.

    - Django is hard. PEP 681 may not be a saving grace either. [3]

    [1] https://peps.python.org/pep-0692/

  • Welcome to hassle free coding
    4 projects | /r/ProgrammerHumor | 28 May 2022
    The whole Python Standard Library: https://github.com/python/typeshed/tree/master/stdlib
  • Python’s “Type Hints” are a bit of a disappointment to me
    15 projects | news.ycombinator.com | 21 Apr 2022
    https://github.com/python/typeshed also provides community maintained stub packages for packages that are lacking upstream type hints
  • Java vs python is debatable 🤔
    3 projects | /r/ProgrammerHumor | 3 Apr 2022
    Using any linter + type checker solves many of your problems. Just annotate your types (possibly using the typing module below Python 3.10), run flake8 and mypy and you're fine. Also c.f. PEP-484 for how and why it was done like this. And use typeshed stubs for untyped libs, most major libraries have typings in there ;)
  • Why Static Languages Suffer From Complexity
    8 projects | /r/rust | 19 Jan 2022
    Do you mean declaration files (*.d.ts) and DefinitelyTyped? Python has equivalents of those in type stubs (*.pyi) and typeshed.

black

Posts with mentions or reviews of black. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-18.
  • Enhance Your Project Quality with These Top Python Libraries
    16 projects | dev.to | 18 Mar 2024
    Black: Known as “The Uncompromising Code Formatter”, Black automatically formats your Python code to conform to the PEP 8 style guide. It takes away the hassle of having to manually adjust your code style.
  • Uv: Python Packaging in Rust
    9 projects | news.ycombinator.com | 15 Feb 2024
  • Let's meet Black: Python Code Formatting
    2 projects | dev.to | 7 Feb 2024
    In the realm of Python development, there is a multitude of code formatters that adhere to PEP 8 guidelines. Today, we will briefly discuss how to install and utilize black.
  • Show HN: Visualize the Entropy of a Codebase with a 3D Force-Directed Graph
    6 projects | news.ycombinator.com | 31 Jan 2024
    Perfect, that worked, thank you!

    I thought this could be solved by changing the directory to src/ and then executing that command, but this didn't work.

    This also seems to be an issue with the web app, e.g. the repository for the formatter black is only one white dot https://dep-tree-explorer.vercel.app/api?repo=https://github...

  • Introducing Flask-Muck: How To Build a Comprehensive Flask REST API in 5 Minutes
    3 projects | dev.to | 20 Dec 2023
  • Embracing Modern Python for Web Development
    12 projects | dev.to | 8 Dec 2023
    Ruff is not only much faster, but it is also very convenient to have an all-in-one solution that replaces multiple other widely used tools: Flake8 (linter), isort (imports sorting), Black (code formatter), autoflake, many Flake8 plugins and more. And it has drop-in parity with these tools, so it is really straightforward to migrate from them to Ruff.
  • Releasing my Python Project
    4 projects | dev.to | 26 Nov 2023
    1. LICENSE: This file contains information about the rights and permissions granted to users regarding the use, modification, distribution, and sharing of the software. I already had an MIT License in my project. 2. pyproject.toml: It is a configuration file typically used for specifying build requirements and backend build systems for Python projects. I was already using this file for Black code formatter configuration. 3. README.md: Used as a documentation file for your project, typically includes project overview, installation instructions and optionally, contribution instructions. 4. example_package_YOUR_USERNAME_HERE: One big change I had to face was restructuring my project, essentially packaging all files in this directory. The name of this directory should be what you want to name your package and shoud not conflict with any of the existing packages. Of course, since its a Python Package, it needs to have an __init__.py. 5. tests/: This is where you put all your unit and integration tests, I think its optional as not all projects will have tests. The rest of the project remains as is.
  • Lute v3 - installed software for learning foreign languages through reading
    2 projects | /r/flask | 15 Nov 2023
    using pylint and black ("the uncompromising code formatter")
  • Testing Python Code Using UnitTest
    3 projects | dev.to | 9 Nov 2023
    It was with this test that I made that I was able to test my parse_md function, previously called check_md_and_write, and locate a bug that I uncovered a last week. I noticed this bug when I was using the linter, Ruff, and formatter, Black, I set up for my project. If you're interested in reading about the linter and formatter I chose and the setup process you can read last week's blog. Essentially the problem was that I could not parse any Markdown in my program. I wasn't sure what the problem was, but I think it had something to do with when I refactored my code and tried to clean things up. Luckily, I still has the branches where I worked on improved the function to parse markdown and the refactoring branch. To make note of it, I made an issue for myself and specified which branches to take a look at.
  • FastAPI Production Setup Guide 🏁⚡️🚀
    6 projects | dev.to | 18 Oct 2023
    Whenever I start a new project I like to maintain quality standards and using automated quality tools makes it easy. Lets go ahead and install mypy for static type checking, black for formatting, and ruff for linting. Add these to the dev dependencies.

What are some alternatives?

When comparing typeshed and black you can also consider the following projects:

autopep8 - A tool that automatically formats Python code to conform to the PEP 8 style guide.

prettier - Prettier is an opinionated code formatter.

yapf - A formatter for Python files

Pylint - It's not just a linter that annoys you!

ruff - An extremely fast Python linter and code formatter, written in Rust.

isort - A Python utility / library to sort imports.

autoflake - Removes unused imports and unused variables as reported by pyflakes

Flake8 - flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.

pycodestyle - Simple Python style checker in one Python file

mypy - Optional static typing for Python

google-java-format - Reformats Java source code to comply with Google Java Style.

pyright - Static Type Checker for Python