Bug 39761 - Add (skip) annotation on tp_foo_new()
Summary: Add (skip) annotation on tp_foo_new()
Status: RESOLVED WONTFIX
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-02 06:17 UTC by Xavier Claessens
Modified: 2012-04-12 07:26 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Xavier Claessens 2011-08-02 06:17:45 UTC
C constructors tp_foo_new() should be pure wrapper arround g_object_new() setting properties. They are confusing in other languages like python where you create your objects with factory = TelepathyGLib.SimpleClientFactory(dbus=bus) instead of factory = TelepathyGLib.SimpleClientFactory.new(dbus) for example. That way pygobject will call g_object_new() itself.
Comment 1 Guillaume Desmottes 2011-08-02 07:40:15 UTC
We have to be carreful here, some _new are more than a wrapper around g_object_new. For example some call tp_dbus_check_valid_object_path().

Also, be sure that work with gjs as well before deprecating.
Comment 2 Simon McVittie 2012-04-12 06:00:26 UTC
I'm inclined to WONTFIX this, because I think having a new() with known and documented parameters makes good documentation even for g-i languages: it's not always instantly obvious which properties you need to pass to the constructor to get a valid object.
Comment 3 Guillaume Desmottes 2012-04-12 06:51:39 UTC
I agree.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.