How to union nested Sets
How to union nested Sets / A single set from nested sets?
Grobu snailcoder at retrosite.invalidWed Jan 6 23:59:34 EST 2016
- Previous message (by thread): How to union nested Sets / A single set from nested sets?
- Next message (by thread): How to union nested Sets / A single set from nested sets?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 04/01/16 03:40, mviljamaa wrote: > I'm forming sets by set.adding to sets and this leads to sets such as: > > Set([ImmutableSet(['a', ImmutableSet(['a'])]), ImmutableSet(['b', 'c'])]) > > Is there way union these to a single set, i.e. get > > Set(['a', 'b', 'c']) > > ? There's a built-in "union" method for sets : >>> a = set( ['a', 'b'] ) >>> b = set( ['c', 'd'] ) >>> a.union(b) set(['a', 'c', 'b', 'd']) HTH
- Previous message (by thread): How to union nested Sets / A single set from nested sets?
- Next message (by thread): How to union nested Sets / A single set from nested sets?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list