Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bde67df0
Commit
bde67df0
authored
Jun 22, 2010
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep UserDict an old-style class
Be generous in abc.py to allow this.
parent
3ceab01c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
Lib/UserDict.py
Lib/UserDict.py
+1
-1
Lib/abc.py
Lib/abc.py
+3
-1
Misc/NEWS
Misc/NEWS
+0
-2
No files found.
Lib/UserDict.py
View file @
bde67df0
"""A more or less complete user-defined wrapper around dictionary objects."""
class
UserDict
(
object
)
:
class
UserDict
:
def
__init__
(
self
,
dict
=
None
,
**
kwargs
):
self
.
data
=
{}
if
dict
is
not
None
:
...
...
Lib/abc.py
View file @
bde67df0
...
...
@@ -3,6 +3,8 @@
"""Abstract Base Classes (ABCs) according to PEP 3119."""
import
types
# Instance of old-style class
class
_C
:
pass
...
...
@@ -101,7 +103,7 @@ class ABCMeta(type):
def
register
(
cls
,
subclass
):
"""Register a virtual subclass of an ABC."""
if
not
isinstance
(
subclass
,
type
):
if
not
isinstance
(
subclass
,
(
type
,
types
.
ClassType
)
):
raise
TypeError
(
"Can only register classes"
)
if
issubclass
(
subclass
,
cls
):
return
# Already a subclass
...
...
Misc/NEWS
View file @
bde67df0
...
...
@@ -971,8 +971,6 @@ Library
position to the given argument, which goes against the tradition of
ftruncate() and other truncation APIs. Patch by Pascal Chambon.
- UserDict is now a new-style class.
- Issue #7610: Reworked implementation of the internal ``zipfile.ZipExtFile``
class used to represent files stored inside an archive. The new
implementation is significantly faster and can be wrapped in a
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment