Fixed pydown to understand imported symbols.

In order to import typing.Union into the module namespace,
I had to fix pydown to recognize Union as a defined symbol.
This commit is contained in:
Don Cross
2023-02-13 13:19:13 -05:00
parent 740ef86d31
commit d73d271a4f
4 changed files with 18 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ import datetime
import enum
import re
import abc
from typing import Union
def _cbrt(x):
if x < 0.0:
@@ -728,7 +729,7 @@ class Time:
such as the orbits of planets around the Sun, or the Moon around the Earth.
Historically, Terrestrial Time has also been known by the term *Ephemeris Time* (ET).
"""
def __init__(self, ut, tt = None):
def __init__(self, ut : Union[float, str], tt = None):
if isinstance(ut, str):
# Undocumented hack, to make repr(time) reversible.
other = Time.Parse(ut)