pycdc icon indicating copy to clipboard operation
pycdc copied to clipboard

Single kwarg subclass in 3.x

Open rocky opened this issue 6 years ago • 0 comments

The following when compiled doesn't decompile in any version of Python 3 (for differing reasons):

Also note that this program is self-checking. You can run the program after deompiling and it will check whether it got decompiled incorrectly.

# Extracted from Python 3.5 test_abc.py
# Bug is class having only a single kwarg
# subclass.
import abc
import unittest
from inspect import isabstract

def test_abstractmethod_integration(self):
    for abstractthing in [abc.abstractmethod]:
        class C(metaclass=abc.ABCMeta):
            @abstractthing
            def foo(self): pass  # abstract
            def bar(self): pass  # concrete
        assert C.__abstractmethods__, {"foo"}
        assert isabstract(C)
        pass

test_abstractmethod_integration(None)

rocky avatar Apr 07 '18 11:04 rocky