MCPcopy Create free account
hub / github.com/PageBot/PageBot / classOf

Function classOf

Lib/pagebot/toolbox/units.py:341–350  ·  view source on GitHub ↗

Answers the class of the Unit instance. Otherwise answer None. >>> u = Em(2) >>> classOf(u) is Em True

(u)

Source from the content-addressed store, hash-verified

339 return u
340
341def classOf(u):
342 """Answers the class of the Unit instance. Otherwise answer None.
343
344 >>> u = Em(2)
345 >>> classOf(u) is Em
346 True
347 """
348 if isUnit(u):
349 return u.__class__
350 return None
351
352def uString(u, maker=None):
353 """Answers the unit `u` as a string. In case it is not a Unit instance,

Callers

nothing calls this directly

Calls 1

isUnitFunction · 0.85

Tested by

no test coverage detected