[Git][ghc/ghc][wip/junit-fixes] Provide dummy definitions

Ben Gamari gitlab at gitlab.haskell.org
Sat Jun 22 00:42:16 UTC 2019



Ben Gamari pushed to branch wip/junit-fixes at Glasgow Haskell Compiler / GHC


Commits:
46163af1 by Ben Gamari at 2019-06-22T00:42:07Z
Provide dummy definitions

- - - - -


2 changed files:

- testsuite/driver/my_typing.py
- + typing_stubs.py


Changes:

=====================================
testsuite/driver/my_typing.py
=====================================
@@ -1,18 +1,8 @@
 try:
     from typing import *
-
-    WayName = NewType("WayName", str)
-    TestName = NewType("TestName", str)
-    OutputNormalizer = Callable[[str], str]
 except:
-    pass
-    #WayName = str
-    #TestName = str
-
-    #class Dummy:
-    #    def __index__(self, ty):
-    #        return None
-
-    #List = Dummy() # type: ignore
-    #Tuple = Dummy() # type: ignore
+    from typing_stubs import * # type: ignore
 
+WayName = NewType("WayName", str)
+TestName = NewType("TestName", str)
+OutputNormalizer = Callable[[str], str]


=====================================
typing_stubs.py
=====================================
@@ -0,0 +1,13 @@
+# Stub definitions for things provided by the typing package
+# for use by older Python versions.
+
+class Dummy:
+    def __index__(self, *args):
+        return None
+
+List = Dummy()
+Tuple = Dummy()
+Set = Dummy()
+TextIO = Dummy()
+Iterator = Dummy()
+Newtype = lambda name, ty: ty



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/46163af1e49b5850065d66333d0c75d65a391fab

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/46163af1e49b5850065d66333d0c75d65a391fab
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190621/0f343368/attachment-0001.html>


More information about the ghc-commits mailing list