wj-Mcat / type-hint-small-trick

a magic hinting for python methods/attributes in IDE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

type-hint-small-trick

a magic hinting trick for paddle Tensor in IDE. Please enjoy the main.py to get more details.

Feature

  • enhance the type hinting for Paddle Tensor in Dev & Runtime mode
  • add stub file for IDE to detect members of Tensor

What I have Done

  1. define the tensor.pyi to define the members of Tensor, which is not sensitive how the Tensor is implemented.
  2. use TYPE_CHECKING to detect the DEV or Runtime mode.

Creators

Copyright & License

About

a magic hinting for python methods/attributes in IDE

License:Apache License 2.0


Languages

Language:Python 100.0%