/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/python/python_append_runme.py
36 строк
880 B
William S Fulton
Fixing setting this in Python when using __slots__
06 фев 2020, 10:08
06 фев 2020, 10:08
a01e847
Код
Авторство
О чём код?
from python_append import * # test not relevant for -builtin if is_python_builtin(): exit(0) t = Test() t.funk() t.static_func() if grabpath() != os.path.dirname(mypath): raise RuntimeError("grabpath failed") if grabstaticpath() != os.path.basename(mypath): raise RuntimeError("grabstaticpath failed") clearstaticpath() if grabstaticpath() != None: raise RuntimeError("Resetting staticfuncpath failed") Test.static_func() if grabstaticpath() != os.path.basename(mypath): raise RuntimeError("grabstaticpath failed") # slots test fs = ForSlots() if fs.ValidVariable != 99: raise RuntimeError("ValidVariable failed") fs.ValidVariable = 11 if fs.ValidVariable != 11: raise RuntimeError("ValidVariable failed") try: fs.Invalid = 22 raise RuntimeError("It should not be possible to set a random variable name") except AttributeError: pass