Accueil
Rechercher:
sur developpez.com sur les forums
Forums | Tutoriels | F.A.Q's | Participez | Hébergement | Contacts
Accueil Conception Java DotNET Visual Basic  C  C++ Delphi MS-Office SQL & SGBD Oracle  4D  Business Intelligence
Club Emploi Blogs   TV   Dév. Web PHP XML Python Autres 2D-3D-Jeux Sécurité Windows Linux PC Mac
FORUM PYTHON F.A.Q PYTHON TUTORIELS PYTHON SOURCES PYTHON OUTILS PYTHON LIVRES PYTHON
5.7.4 Comparison to the built-in set types


5.7.4 Comparison to the built-in set types

The built-in set and frozenset types were designed based on lessons learned from the sets module. The key differences are:

  • Set and ImmutableSet were renamed to set and frozenset.
  • There is no equivalent to BaseSet. Instead, use isinstance(x, (set, frozenset)).
  • The hash algorithm for the built-ins performs significantly better (fewer collisions) for most datasets.
  • The built-in versions have more space efficient pickles.
  • The built-in versions do not have a union_update() method. Instead, use the update() method which is equivalent.
  • The built-in versions do not have a _repr(sorted=True) method. Instead, use the built-in repr() and sorted() functions: repr(sorted(s)).
  • The built-in version does not have a protocol for automatic conversion to immutable. Many found this feature to be confusing and no one in the community reported having found real uses for it.
See About this document... for information on suggesting changes.
Responsable bénévole de la rubrique Python : Guillaume Duriaud - Contacter par EMail :
Vos questions techniques : forum d'entraide Python - Publiez vos articles, tutoriels et cours
et rejoignez-nous dans l'équipe de rédaction du club d'entraide des développeurs francophones
Nous contacter - Copyright © 2000-2008 www.developpez.com - Legal informations.