0

这按记录工作:

  with driver.session() as session:

但我的 linter 对此抛出了一个错误:

  session = driver.session()

  > Assigning result of a function call, where the function has no returnpylint(assignment-from-no-return)

在此处输入图像描述

我认为这with只是处理关闭句柄等的语法糖。

请注意,代码本身会运行,但 linter 错误确实会分散注意力。有没有办法修复原始代码

我正在尝试让会话对象用于多个事务(或我的应用程序的生命周期)

https://neo4j.com/docs/api/python-driver/current/driver.html#neo4j.Driver.session

来源在这里 https://github.com/neo4j/neo4j-python-driver

4

0 回答 0