Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pygobject
pygobject
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 149
    • Issues 149
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Registry
    • Registry
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • pygobjectpygobject
  • Issues
  • #271

Closed
Open
Opened Oct 21, 2018 by Kai Willadsen@kaiw
  • Report abuse
  • New issue
Report abuse New issue

Overrides wrapping decorator makes some introspection impractical

Let me start by saying that I'm doing weird things that you might not want to support, in which case fair enough.

The wraps() decorator defined in in gi/overrides/__init__.py correctly copies across name and module, but misses several other important object properties (e.g., annotations, documentation). It also doesn't do the nice thing of adding a __wrapped__ attribute that points to the wrapped function.

As a result, introspection on e.g., Gtk.TextIter.forward_search() will give the strip_boolean_result wrapper function, preventing introspection of the actual signature of forward_search().

The easy fix for this is to replace the wraps() function in overrides with functools.wraps() from the standard library. I'll happily put together a patch for this if that seems sensible.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
No due date
0
Labels
None
Assign labels
  • View project labels
Reference: GNOME/pygobject#271