Rainer ...

That is legitimate Python syntax for unpacking a sequence of tuples 
where the tuples each have a single value.  As an example, this code:

a = ((1,),(2,),(3,))
for b, in a:
    print b

Will result in this output:

1
2
3

WIthout the comma, it would produce this output:

a = ((1,),(2,),(3,))
for b in a:
    print b

(1,)
(2,)
(3,)

I'll admit that the code you identified is odd, and probably could use a 
little more documentation, but it's correct code for the circumstance.

- Craig -

Rainer Sokoll wrote:
> Hi,
>
> in notification.py
> (http://trac.edgewall.org/browser/tags/trac-0.10.3/trac/ticket/notification.py),
> I came across lines 234 and 239. I have no idea about python, but are
> the commas in "for updater, in cursor:" correct python syntax? I've
> never seen that in other languages.
>
> Rainer
>
> >   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to