mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Merge r60628, r60631, and r60633. Register UserList and UserString will the appropriate ABCs.
This commit is contained in:
parent
017b6a3ad2
commit
882a416900
3 changed files with 14 additions and 45 deletions
|
@ -1,6 +1,8 @@
|
|||
"""A more or less complete user-defined wrapper around list objects."""
|
||||
|
||||
class UserList:
|
||||
import collections
|
||||
|
||||
class UserList(collections.MutableSequence):
|
||||
def __init__(self, initlist=None):
|
||||
self.data = []
|
||||
if initlist is not None:
|
||||
|
@ -83,3 +85,5 @@ class UserList:
|
|||
self.data.extend(other.data)
|
||||
else:
|
||||
self.data.extend(other)
|
||||
|
||||
collections.MutableSequence.register(UserList)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue