小编den*_*uan的帖子

应该使用链接调用来支持更明确的分配吗?

我们的团队必须如下所示:

这个:

buf = StringIO.StringIO()
gzip.GzipFile(fileobj=buf, mode='wb').write(foo)
...
Run Code Online (Sandbox Code Playgroud)

还有这个:

buf = StringIO.StringIO()
tmp = gzip.GzipFile(fileobj=buf, mode='wb')
tmp.write(foo)
...
Run Code Online (Sandbox Code Playgroud)

哪一个更pythonic?

编辑:我已经尝试/ catch来做错误处理工作,但哪一个更pythonic?

python stringio python-2.7

3
推荐指数
1
解决办法
90
查看次数

标签 统计

python ×1

python-2.7 ×1

stringio ×1