[issue43595] Can not add a metclass that inherits both ABCMeta & ABC to a Union

2021-06-28 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Works for me, too - no error (MacOS, 3.9.1)

--
nosy: +andrei.avk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43595] Can not add a metclass that inherits both ABCMeta & ABC to a Union

2021-03-23 Thread Jacob Nilsson


Jacob Nilsson  added the comment:

Hi, I tried both code snippets, and they work for me with the output:

typing.Union[str, abc.ABC]

For your second code snippet.

Tested on 3.7.6 (IPython though) on a Windows machine, can test it on Linux 
tomorrow.

--
nosy: +ajoino

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43595] Can not add a metclass that inherits both ABCMeta & ABC to a Union

2021-03-22 Thread Erez Zinman


Erez Zinman  added the comment:

This is actually a lot worse and unrelated to the aforementioned issue.

The code 

```
from typing import Union
from abc import ABC


Union[str, ABC]
```

raises the exception

 >>> TypeError: descriptor '__subclasses__' of 'type' object needs an argument

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43595] Can not add a metclass that inherits both ABCMeta & ABC to a Union

2021-03-22 Thread Erez Zinman


New submission from Erez Zinman :

Related to Issue #43594.

When running the following code

```
from abc import ABCMeta, ABC
from typing import Union

class MetaclassMixin(ABC):
pass 

class Meta(MetaclassMixin, ABCMeta):
pass

print(Union[str, Meta])
```

An exception is raised

 >>> TypeError: descriptor '__subclasses__' of 'type' object needs an argument


Tested on v3.6.9

--
messages: 389317
nosy: erezinman
priority: normal
severity: normal
status: open
title: Can not add a metclass that inherits both ABCMeta & ABC to a Union
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com