/
valemobil
/
python-future
Обзор
Документация
Войти
/
valemobil
/
python-future
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/libfuturize/fixes/fix_object.py
17 строк
407 B
Ed Schofield
Docs (mostly): Update references to future.builtins -> builtins
01 окт 2014, 10:48
01 окт 2014, 10:48
4002f59
Код
Авторство
О чём код?
""" Fixer that adds ``from builtins import object`` if there is a line like this: class Foo(object): """ from lib2to3 import fixer_base from libfuturize.fixer_util import touch_import_top class FixObject(fixer_base.BaseFix): PATTERN = u"classdef< 'class' NAME '(' name='object' ')' colon=':' any >" def transform(self, node, results): touch_import_top(u'builtins', 'object', node)