question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Convert typing declarations to use TypeAlias

See original GitHub issue

See discussion here: https://github.com/pandas-dev/pandas-stubs/pull/341#issuecomment-1262928643

Should we change _typing.pyi to make all these types that we create be declared with TypeAlias (imported from typing_extensions) ?

@twoertwein - your opinion?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
AlexWaygoodcommented, Sep 30, 2022

Fun fact: typeshed pretends that typing_extensions is part of the standard library, meaning that all type checkers also believe that typing_extensions is part of the standard library. This means that (since this is a stubs-only project, and will never be executed at runtime) you should be able to use types from typing_extensions (and also _typeshed, which we treat similarly) without adding a dependency on typing_extensions 😃

1reaction
twoertweincommented, Oct 1, 2022

This means that (since this is a stubs-only project, and will never be executed at runtime) you should be able to use types from typing_extensions (and also _typeshed, which we treat similarly) without adding a dependency on typing_extensions 😃

Could also start using _typeshed.Self in the stubs (Y019) @Dr-Irv

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Use Type Aliases in TypeScript - DigitalOcean
Using the type alias can solve this. Step 2 — Using Type Alias. To implement the type alias, use the type keyword to...
Read more >
Types: Type Aliases - HHVM and Hack Documentation
A type alias can be created in two ways: using type and newtype . type Complex = shape('real' => float, 'imag' => float);...
Read more >
How to use a Typescript type alias of a function type on a ...
I have this type alias with a function type. type ADD_FUNCTION = (x: number, y: number) => number;. I can do this:
Read more >
Expected meaning of `<Alias>: typing.TypeAlias = typing ...
from typing import TypeAlias, ClassVar, get_type_hints ClassAlias: TypeAlias = ClassVar[str] class A: i: ClassAlias = "g" # No errors class ...
Read more >
Swift typealias: What is it and when to use it - Sarunw
Type alias declarations are declared using the typealias keyword and have the following form: typealias name = existing type.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found