Skip to content
  • Simon Feltman's avatar
    Add callable and descriptor protocols to PyGICallableInfo · 35f79b22
    Simon Feltman authored
    Add tp_call (__call__) function to callable info objects.
    This allows for replacement of wrapped invoke methods directly
    with the already created callable info object. This has the
    additional side effect of making doc strings lazily bound
    (only generated when __doc__ is accessed).
    
    Add tp_desc_get (__get__) to PyGIFunctionInfo which returns
    a bound version of itself for methods and constructors.
    
    Update various internal type checks to reflect the changes.
    Update tests to reflect the new callable type being the same
    across Python 2 & 3.
    
    This patch gives roughly a %17 speedup for Gtk imports and
    an %11 speedup for GI method calls.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704037
    35f79b22