cpython: 1e49abb03e0f (original) (raw)

Mercurial > cpython

changeset 105188:1e49abb03e0f 3.5

Issue #28556: two more small upstream changes by Ivan Levkivskyi (#329, #330) [#28556]

Guido van Rossum guido@python.org
date Sat, 19 Nov 2016 10:32:41 -0800
parents 20f62e4a9c2f
children cdddf4ee0e00 02f416441def
files Lib/test/test_typing.py Lib/typing.py
diffstat 2 files changed, 21 insertions(+), 2 deletions(-)[+] [-] Lib/test/test_typing.py 21 Lib/typing.py 2

line wrap: on

line diff

--- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -45,6 +45,10 @@ class BaseTestCase(TestCase): message += ' : %s' % msg raise self.failureException(message)

+ class Employee: pass @@ -509,6 +513,13 @@ class ProtocolTests(BaseTestCase): def test_protocol_instance_type_error(self): with self.assertRaises(TypeError): isinstance(0, typing.SupportsAbs)

class GenericTests(BaseTestCase): @@ -748,8 +759,12 @@ class GenericTests(BaseTestCase): class CC: ... self.assertEqual(get_type_hints(foobar, globals(), locals()), {'x': List[List[CC]]}) T = TypeVar('T')

def test_extended_generic_rules_subclassing(self): class T1(Tuple[T, KT]): ... @@ -800,6 +815,8 @@ class GenericTests(BaseTestCase): def test_type_erasure_special(self): T = TypeVar('T')

--- a/Lib/typing.py +++ b/Lib/typing.py @@ -1503,6 +1503,8 @@ class _ProtocolMeta(GenericMeta): """ def instancecheck(self, obj):

def subclasscheck(self, cls):