On 2012-12-05, Andrew Mathas <andrew.mat...@sydney.edu.au> wrote:
> ------=_Part_33_6944284.1354751535501
> Content-Type: text/plain; charset=ISO-8859-1
>
> Here's a related question: suppose I have an object G in sage. Is there a 
> "correct" way to ask G if is it a CombinatorialFreeModule? I can check for
>
> if hasattr(G,'_basis_keys'): ...
>
> but I would have thought that there was a better way to do this...
isinstance?


sage: F = CombinatorialFreeModule(QQ, ['a','b','c'])
sage: isinstance(F,CombinatorialFreeModule)
True
sage: isinstance([],CombinatorialFreeModule)
False

HTH,
Dima
>
> Andrew
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to