Category

Category#

class discopy.cat.Category(ob=None, ar=None)[source]#

Bases: object

A category is just a pair of Python types ob and ar with appropriate methods dom, cod, id and then.

Parameters:
  • ob (type) – The objects of the category, default is Ob.

  • ar (type) – The arrows of the category, default is Arrow.

Example

>>> Category()
Category(cat.Ob, cat.Arrow)
>>> CAT
Category(cat.Category, cat.Functor)
ob#

alias of Ob

ar#

alias of Arrow