Julien Cigar ha scritto:
> Glauco wrote:
>   
>> Julien Cigar ha scritto:
>>   
>>     
>>> 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 ? 
>>>     
>>>       
>> I don't think so, because the default order is an information !
>>
>>
>> a == b is a comparo of content so [1,2,3] is different than [3,2,1]
>> sometimes ordering in presentation of data is a useful information.
>>
>>   
>>     
>
> yes of course [1,2,3] is different than [3,2,1] (hopefully), I was 
> talking for InstrumentedList, not tuple or list or ...
>   
see: http://www.sqlalchemy.org/docs/datamapping.html
""" By default it represents a list: """




Glauco

-- 
+------------------------------------------------------------+
                                  Glauco Uri - Programmatore
                                    glauco(at)allevatori.com 
                               
  Sfera Carta Software®      [EMAIL PROTECTED]
  Via Bazzanese,69  Casalecchio di Reno(BO) - Tel. 051591054 
+------------------------------------------------------------+



--~--~---------~--~----~------------~-------~--~----~
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