有人可以向我解释这段python代码吗?

时间:2018-08-20 12:40:26

标签: python

我试图弄清楚随后的python代码行实际上是做什么的:

org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
    at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:289)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:447)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
    at com.sun.proxy.$Proxy56.listRequesterData(Unknown Source)
    at nl.naturalis.nrs.controller.NummerreeksController.getRequesterList(NummerreeksController.java:547)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)

我认为它执行以下某种逻辑:

if (var1 and var1) in [ctl for key, value in list(uof.items()) for ctl, com in list(cd.items()) if com == 'spain']:
    my_var= uof_map[var1 ]

但显然结果确实有所不同。有人可以指出我正确的方向吗?

注意:

for key, values in list(uof.items()): for ctl, com in list(values.items()): if com == 'spain': 是词典的字典

uof是字典

0 个答案:

没有答案