File: tp.hy

package info (click to toggle)
hy 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,640 kB
  • sloc: python: 7,299; makefile: 38; sh: 27
file content (10 lines) | stat: -rw-r--r-- 259 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
"Helpers for testing type parameters."

(import typing [TypeVar TypeVarTuple ParamSpec TypeAliasType])

(defn show [f]
  (lfor
    tp f.__type_params__
    [(type tp) tp.__name__
      (getattr tp "__bound__" None)
      (getattr tp "__constraints__" #())]))