[New-bugs-announce] [issue3069] Let set.union and set.intersection accept multiple arguments

Arnaud Delobelle report at bugs.python.org
Tue Jun 10 01:01:52 CEST 2008


New submission from Arnaud Delobelle <arnodel at googlemail.com>:

The patch allows the following syntax for s set/frozenset:
* s.union(a, b, c,...)
* s.update(a, b, c,...)
* s.intersection(a, b, c,...)
* s.intersection_update(a, b, c,...)

By extension:
* set.union(a, b, c,...) # provided a is a set/frozenset
* ...

Union is extended by iterative application of set_union_internal
Intersection is optimized by sorting all sets/frozensets/dicts in 
increasing order of size and only iterating over elements in the 
smallest.

This was discussed on python-ideas:
http://groups.google.com/group/python-
ideas/browse_thread/thread/945a6c989ab905a3/54defd5e62b9a2a6

----------
components: Interpreter Core
files: set_ui_varargs.diff
keywords: patch
messages: 67878
nosy: arno
severity: normal
status: open
title: Let set.union and set.intersection accept multiple arguments
type: feature request
versions: Python 3.0
Added file: http://bugs.python.org/file10565/set_ui_varargs.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3069>
_______________________________________


More information about the New-bugs-announce mailing list