Hi list,

With the following :

 >>> a = Invasive.get(67).habitats
 >>> b = Invasive.get(57).habitats
 >>> type(a), type(b)
(<class 'sqlalchemy.orm.attributes.InstrumentedList'>, <class 
'sqlalchemy.orm.attributes.InstrumentedList'>)
 >>> a == b
True
 >>> a
[<tgias.models.habitat.Habitat object at 0x8d635ec>, 
<tgias.models.habitat.Habitat object at 0x8d5d8ec>]
 >>> b
[<tgias.models.habitat.Habitat object at 0x8d635ec>, 
<tgias.models.habitat.Habitat object at 0x8d5d8ec>]
 >>> a.reverse()
 >>> a
[<tgias.models.habitat.Habitat object at 0x8d5d8ec>, 
<tgias.models.habitat.Habitat object at 0x8d635ec>]
 >>> b
[<tgias.models.habitat.Habitat object at 0x8d635ec>, 
<tgias.models.habitat.Habitat object at 0x8d5d8ec>]
 >>> a == b
False

Would it not be logical to have True instead of False for the last 
statement ? Do you think the order of an InstrumentedList is important 
for collections (in a boolean context) ?

thanks

Regards,
Julien

-- 
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
office: [EMAIL PROTECTED]
home: [EMAIL PROTECTED]
biobel reference: http://biobel.biodiversity.be/biobel/person/show/471


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to