����� > ����� ����� ����� > ����� �����

����� �����

UserDict � ����� �����. 

������ �� ���� ���� ������� ������� ������ ����� �� �����. ��� ����� ��� ��� ��� ���� ������ ����� �� ������ ���, ������ ������ ������ �����, ������� �� ���� ������������� �� ������� ��������, ������ ���� ���: UserString, UserList �- UserDict. ����� ����� �� ������ ������ ��������, ������ UserDict ���� ����� ����� ���� ����, �� ��� ����� ��� ������� ����� ���� ����.

class UserDict:
 
   def __init_
_(self, dict=None):

        self.data = {}
        if dict is not None: self.update(dict)

������ �� ���� ��� ������ �������� ����� ������

���� ���� ������ ������ �� ������ UserDict:

def clear(self): self.data.clear()
def copy(self):
if self.__class__ is UserDict:
return UserDict(self.data)
import copy
return copy.copy(self)
def keys(self): return self.data.keys()
def items(self): return self.data.items()
def value
s(self): return self.data.values() 

������ �� ���� ��� ������ �������� ����� ������

 
���� ����
�����
�����
�����
�����
��������
����� ������
������ ������
����� ������ - �����
����� ����� �����
�������
����
���� �������
������� ����