On 2010-04-21, Matti Airas wrote:
> On 21.04.2010 15:35, Airas Matti.P (Nokia-D/Tampere) wrote:
> > OK, nice. I can modify the draft accordingly and send an updated version
> > for you for review.
> 
> The changes were quite small:
> 
> diff --git a/psep-0101.txt b/psep-0101.txt
> index 465c491..0738f24 100644
> --- a/psep-0101.txt
> +++ b/psep-0101.txt
> @@ -64,19 +64,11 @@ adopting API 2 regarding QVariant, that is,
> automatic conver
>   from QVariant wherever QVariants must be passed as arguments and when
>   QVariants are returned. But in addition, the QVariant class is kept in
>   the API so that programmers can pass a QVariant explicitly if they need
> -to. To support the creation of QVariants either a single factory
> -function or a set of static functions would be needed, e.g.::
> +to. To support the creation of QVariants a set of static functions named
> +after the types in QVariant.Type are implemented, e.g.::
> 
> -    # static functions approach
> -    QVariant.ushort(pythonObject) -> QVariant
> -    QVariant.uint(pythonObject) -> QVariant
> -
> -    # factory function approach (based on Richard Dale's ideas)
> -    QVariant("ushort", pythonObject) -> QVariant
> -    QVariant("uint", pythonObject) -> QVariant
> -
> -The factory function is more versatile since it can be extended without
> -introducing API changes.
> +    QVariant.fromUInt(pythonObject) -> QVariant
> +    QVariant.fromInt(pythonObject) -> QVariant
> 
>   By supporting automatic conversion to and from QVariants, any Python
>   object (including dicts, lists, and tuples) can be used wherever a
> 
> 
> If that's OK, I'll update the draft.

Looks fine to me.

But since only QtDBus needed this and you're going to use dbus-python,
couldn't we just defer this unless/until it is needed? Then we get a
nice clean no-QVariant API:-)

(But I'm don't feel _strongly_ about it, so don't mind either way.)


-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Advanced Qt Programming" - ISBN 0321635906
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to