Skip to content
Commit 175d1066 authored by Christoph Reiter's avatar Christoph Reiter 🐍
Browse files

Use a named tuple for returning multiple values

>>> v = Gtk.Button().get_alignment()
>>> v
(xalign=0.5, yalign=0.5)
>>> v.xalign
0.5

For each GICallable a new gi._gi.ResultTuple subclass
is created which knows the return value names of that
callable and displays them in __repr__, __dir__ and
allows to access tuple items by name.

The subclass is cached in PyGICallableCache.

To reduce the number of small tuple allocations use a free list
similar to the one used for pure tuples in CPython.

https://bugzilla.gnome.org/show_bug.cgi?id=727374
parent b1788c9a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment