将py3解压缩转换为py2

时间:2019-05-02 14:22:25

标签: python python-3.x python-2.7 dictionary iterable-unpacking

尝试将enablesReturnKeyAutomatically转换为python 2,但我陷入了这一行:

resp = getattr(requests, method)(
    url, **{**self._default_request_kwargs, **kwargs}
)

其中:

 @property
 def _default_request_kwargs(self):
     if self._logged_in:
         return {'cookies': {'BrickAPI': self._session_id}}
     elif not self._logged_in and self._session_id:
         return {'auth': (self._session_id, 'x')}
     else:
         return {}

python 2等效于什么?

0 个答案:

没有答案