Using `pyside6-metaobjectdump` on this MWE will fail
AttributeError: 'Call' object has no attribute 'id'
from abc import ABC, abstractmethod from PySide6.QtCore import QObject class Dialog(ABC): @abstractmethod def execute(self) -> bool: raise NotImplementedError("User must define 'execute' to use this interface") class MyMetaQMLClass(type(QObject), type(Dialog)): pass class MyQMLObject(Dialog, QObject, metaclass=MyMetaQMLClass): pass
Looking at the source in metaobjectdump,
def _name(node: Union[ast.Name, ast.Attribute]) -> str:
"""Return the name of something that is either an attribute or a name,
such as base classes or call.func"""
if isinstance(node, ast.Attribute):
qualifier, name = _attribute(node)
return f"{qualifier}.{node.attr}"
return node.id
I don't know why the node doesn't have an id, but maybe the way we create our metaclass is wrong? It fails on the `(` in class MyMetaQMLClass*(*
- relates to
-
PYSIDE-1767 Pyside6/Shiboken and ABCMeta Bug
-
- Reported
-
| For Gerrit Dashboard: PYSIDE-2202 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 455964,3 | pyside6-metaobjectdump: Skip call operators in base class specification | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
| 456064,2 | pyside6-metaobjectdump: Skip call operators in base class specification | 6.4 | pyside/pyside-setup | Status: MERGED | +2 | 0 |