New submission from Oskar Weser:

There is a code example about the set type found under:
https://docs.python.org/3/tutorial/datastructures.html

It reads as:
```
>>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
>>> print(basket)                      # show that duplicates have been removed
{'orange', 'banana', 'pear', 'apple'}
>>> 'orange' in basket                 # fast membership testing
True
>>> 'crabgrass' in basket
False

>>> # Demonstrate set operations on unique letters from two words
...
>>> a = set('abracadabra')
>>> b = set('alacazam')
>>> a                                  # unique letters in a
{'a', 'r', 'b', 'c', 'd'}
>>> a - b                              # letters in a but not in b
{'r', 'd', 'b'}
>>> a | b                              # letters in either a or b
```

I read "either a or b" as "a .EXOR. b". Shouldn't it be:
```
>>> a | b                              # letters in a or b
```
I don't speak English as a native language, so perhaps I am wrong.

----------
assignee: docs@python
components: Documentation
messages: 293291
nosy: docs@python, mcocdawc
priority: normal
severity: normal
status: open
title: Small correction in set code sample
versions: Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30312>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to