mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
17 lines
327 B
Python
17 lines
327 B
Python
class GenericMeta(type):
|
|
def __getitem__(self, args):
|
|
pass
|
|
|
|
|
|
class Generic(object):
|
|
__metaclass__ = GenericMeta
|
|
|
|
|
|
class C(Generic['foo']):
|
|
pass
|
|
|
|
|
|
print(C['bar'])
|
|
c = C()
|
|
print(c<warning descr="Class 'C' does not define '__getitem__', so the '[]' operator cannot be used on its instances">[</warning>'baz'])
|