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 243
    • Issues 243
    • 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
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • pygobjectpygobject
  • Issues
  • #211

Closed
Open
Created May 01, 2018 by Christoph Reiter@creiter🐍Maintainer

GObject.Property: allow specifying the property name

It came up on IRC that if you have a code base that works with properties of GObjects and properties defined in Python with the GObject.Property() decorator, the later can be accessed as a direct attribute/property while the former can not.

This can than lead to code which sometimes accesses properties through "obj.props.name" or through "obj.name", potentially confusing new contributes who might think that there is a difference.

An idea to limit this is to make it possible to make to make the getter/setter private and pass the name separately.

class Foo(...):
    @GObject.Property(name="foo")
    def _foo(...):
        ....

This would make code accessing the property more likely use the common "obj.props.name" way.

@mschraal

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None