Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
31b853fb
Unverified
提交
31b853fb
authored
12月 08, 2018
作者:
Frédéric Bastien
提交者:
GitHub
12月 08, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6664 from andyfaff/deprec
MAINT: collections import is deprecated
上级
dd6595ba
3262b2a2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
7 行删除
+16
-7
__init__.py
theano/compat/__init__.py
+10
-6
ordered_set.py
theano/misc/ordered_set.py
+6
-1
没有找到文件。
theano/compat/__init__.py
浏览文件 @
31b853fb
...
@@ -6,7 +6,15 @@ from __future__ import absolute_import, print_function, division
...
@@ -6,7 +6,15 @@ from __future__ import absolute_import, print_function, division
from
six
import
PY3
,
b
,
BytesIO
,
next
from
six
import
PY3
,
b
,
BytesIO
,
next
from
six.moves
import
configparser
from
six.moves
import
configparser
from
six.moves
import
reload_module
as
reload
from
six.moves
import
reload_module
as
reload
import
collections
try
:
from
collections.abc
import
(
OrderedDict
,
MutableMapping
as
DictMixin
,
Callable
)
except
ImportError
:
# this raises an DeprecationWarning on py37 and will become
# and Exception in py38. Importing from collections.abc
# won't work on py27
from
collections
import
(
OrderedDict
,
MutableMapping
as
DictMixin
,
Callable
)
__all__
=
[
'PY3'
,
'b'
,
'BytesIO'
,
'next'
,
'configparser'
,
'reload'
]
__all__
=
[
'PY3'
,
'b'
,
'BytesIO'
,
'next'
,
'configparser'
,
'reload'
]
...
@@ -37,8 +45,6 @@ if PY3:
...
@@ -37,8 +45,6 @@ if PY3:
return
unbound
.
__func__
return
unbound
.
__func__
return
unbound
return
unbound
from
collections
import
OrderedDict
,
MutableMapping
as
DictMixin
def
decode
(
x
):
def
decode
(
x
):
return
x
.
decode
()
return
x
.
decode
()
...
@@ -58,8 +64,6 @@ else:
...
@@ -58,8 +64,6 @@ else:
cmp
=
cmp
cmp
=
cmp
from
collections
import
OrderedDict
,
MutableMapping
as
DictMixin
def
decode
(
x
):
def
decode
(
x
):
return
x
return
x
...
@@ -76,7 +80,7 @@ __all__ += ['cmp', 'operator_div', 'DictMixin', 'OrderedDict', 'decode',
...
@@ -76,7 +80,7 @@ __all__ += ['cmp', 'operator_div', 'DictMixin', 'OrderedDict', 'decode',
class
DefaultOrderedDict
(
OrderedDict
):
class
DefaultOrderedDict
(
OrderedDict
):
def
__init__
(
self
,
default_factory
=
None
,
*
a
,
**
kw
):
def
__init__
(
self
,
default_factory
=
None
,
*
a
,
**
kw
):
if
(
default_factory
is
not
None
and
if
(
default_factory
is
not
None
and
not
isinstance
(
default_factory
,
collections
.
Callable
)):
not
isinstance
(
default_factory
,
Callable
)):
raise
TypeError
(
'first argument must be callable'
)
raise
TypeError
(
'first argument must be callable'
)
OrderedDict
.
__init__
(
self
,
*
a
,
**
kw
)
OrderedDict
.
__init__
(
self
,
*
a
,
**
kw
)
self
.
default_factory
=
default_factory
self
.
default_factory
=
default_factory
...
...
theano/misc/ordered_set.py
浏览文件 @
31b853fb
from
__future__
import
absolute_import
,
print_function
,
division
from
__future__
import
absolute_import
,
print_function
,
division
from
collections
import
MutableSet
try
:
from
collections.abc
import
MutableSet
except
ImportError
:
# this raises an DeprecationWarning on py37 and will become
# an Exception in py38
from
collections
import
MutableSet
import
types
import
types
import
weakref
import
weakref
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论