I was playing around with defining new types and have seen the\nfollowing behaviour:\n\nPython 2.3.1\n============\n <type 'int'>\n\nBasicly: Int is not closed under it's defined operations. :-(\n\n\nby contrast:\n[QUOTE][QUOTE][QUOTE]\nclass myset(Set):pass ....\na = myset([1,2])\nb = myset([2,3])\nc = a & b\ntype(c)[/QUOTE][/QUOTE][/QUOTE]\n<class '__main__.myset'>\n\nsubclasses of Set are closed under the set operations. :-)\n\nShould I consider this as a bug or something I have to live with?\n\nExample, why this can be problematic:\nConsider, I want to define an integer subtype that holds integers modulo N.\n\nThe straight forward way would be:\n\nclass mod7(int):\n def __new__(cls,value):\n return int.__new__(cls,value%7)\n\nSince addition, substraction, etc. doesn't work as expected, one must\nredefine all relevant operators. \nThis is not what I'd consider object oriented behaviour.\n\nStephan\n\nP.S.: for the mind police out there: Other than that, Python is great.