#4183: [with patch, needs review] ?? can't always find the source for new style
classes
----------------------------+-----------------------------------------------
Reporter: robertwb | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-3.1.3
Component: user interface | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Changes (by aginiewicz):
* summary: ?? can't always find the source for new style classes =>
[with patch, needs review] ?? can't always find
the source for new style classes
Comment:
Used other approach, above with type equal class is true for too much, for
example:
{{{
sage: type(arg)
<type 'function'>
sage: arg.__class__
<type 'function'>
}}}
Check like:
{{{obj.__class__.__module__ not in ('__builtin__', 'exceptions')}}}
seems to work both old and new style classes, the problem seems to be that
everything is object, so best we can do is check if something is object of
non built-in class
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4183#comment:3>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---