我在 python2 中使用 fstrings,pip install future-fstrings
如下所示:
# -*- coding: future_fstrings -*-
class A(object):
def __init__(self, **kw):
self.__dict__.update(**kw)
print (f'{self.a}')
print (f'{self.b}')
print (f'{self.c}')
A(a=1,b=2,c=3)
但是,将这样的文件提交到我的项目时,我得到:
flake8 (Python 3.6 syntax check).....................(no files to check)Skipped
flake8 (Python 2.7)......................................................Failed
hookid: flake8
file_name:0:1: E999 SyntaxError: unknown encoding: future_fstrings
为什么会发生这种情况,我该如何解决?
# noqa E999
没有帮助...