Answers if u is an instance of Unit. >>> isUnit(pt(20)) True >>> isUnit(pt(20, 21)) False >>> isUnit(2) False
(u)
| 291 | return False |
| 292 | |
| 293 | def isUnit(u): |
| 294 | """Answers if u is an instance of Unit. |
| 295 | |
| 296 | >>> isUnit(pt(20)) |
| 297 | True |
| 298 | >>> isUnit(pt(20, 21)) |
| 299 | False |
| 300 | >>> isUnit(2) |
| 301 | False |
| 302 | """ |
| 303 | # FIXME: |
| 304 | # isinstance(u, Unit) # Does not seem to work correctly for units created |
| 305 | # in other sources, such as A4. |
| 306 | return hasattr(u, 'v') and hasattr(u, 'g') and hasattr(u, 'base') |
| 307 | |
| 308 | def uRound(u, *args): |
| 309 | """Answers the list with rounded units (and all of the other items in the |
no outgoing calls
no test coverage detected