This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Base(object): | |
def __init__(self, arg): | |
self.arg = arg | |
class BaseL(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding:utf-8 -*- | |
u''' | |
多重継承を制限するクラスを作って、そのクラスから導出されたクラスが多重継承していたらエラーを吐くメタクラス | |
''' | |
class MultipleInheritanceLimitedError(TypeError): | |
pass | |
def get_limitation_class(cls): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding:utf-8 -*- | |
import traceback | |
def aaa(cls): | |
__class__ = cls | |
def bbb(y): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define self (*this) | |
#define except catch | |
#define elif else if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import traceback | |
class MetaClassA(type): | |
pass | |
class MetaClassAA(MetaClassA): | |
pass | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template <int start, int end> | |
class Sum | |
{ | |
template <int _start, int _end, int _result> | |
class Internal | |
{ | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> isinstance(type, object) | |
True | |
>>> isinstance(object, type) | |
True | |
>>> type(object) | |
<type 'type'> | |
>>> type(type) | |
<type 'type'> | |
>>> issubclass(type, object) | |
True |