• Victor Stinner's avatar
    bpo-27535: Optimize warnings.warn() (#4508) · 82656276
    Victor Stinner yazdı
    * Optimize warnings.filterwarnings(). Replace re.compile('') with
      None to avoid the cost of calling a regex.match() method, whereas
      it always matchs.
    * Optimize get_warnings_attr(): replace PyObject_GetAttrString() with
      _PyObject_GetAttrId().
    
    Cleanup also create_filter():
    
    * Use _Py_IDENTIFIER() to allow to cleanup strings at Python
      finalization
    * Replace Py_FatalError() with a regular exceptions
    82656276
warnings.py 18.6 KB