Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
pygobject
pygobject
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 241
    • Issues 241
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 12
    • Merge Requests 12
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • pygobjectpygobject
  • Issues
  • #271

Closed
Open
Opened Oct 21, 2018 by Kai Willadsen@kaiwDeveloper

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
None
Reference: GNOME/pygobject#271