• Nate's avatar
    bpo-29581: bpo-29581: Make ABCMeta.__new__ pass **kwargs to type.__new__ (GH-527) (GH-1282) · 6fb12b5c
    Nate yazdı
    Many metaclasses in the standard library don't play nice with
    __init_subclass__. This bug makes ABCMeta in particular with
    __init_subclass__, which is an 80/20 solution for me personally.
    AFAICT, a general solution to this problem requires updating all
    metaclasses in the standard library to make sure they pass **kwargs to
    type.__new__, whereas this PR only fixes ABCMeta. For context, see
    https://bugs.python.org/issue29581.
    
    * added a test combining ABCMeta and __init_subclass__
    * Added NEWS item
    
    (cherry picked from commit bd583ef9)
    
    * [3.6] bpo-29581: Make ABCMeta.__new__ pass **kwargs to type.__new__ (GH-527)
    
    Many metaclasses in the standard library don't play nice with
    __init_subclass__. This bug makes ABCMeta in particular with
    __init_subclass__, which is an 80/20 solution for me personally.
    AFAICT, a general solution to this problem requires updating all
    metaclasses in the standard library to make sure they pass **kwargs to
    type.__new__, whereas this PR only fixes ABCMeta. For context, see
    https://bugs.python.org/issue29581.
    
    * added a test combining ABCMeta and __init_subclass__
    * Added NEWS item.
    (cherry picked from commit bd583ef9)
    
    * **kwargs -> ``kwargs`` in attempts to fix the Travis build.
    
    * Quote the **kwargs
    6fb12b5c
test_abc.py 13.8 KB