You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
datastructure.patch: tries to improvise upon current patch and makes example more clear
datastructures.diff: Updating an example to remove unused assignment. Corrected spacing from previous patch.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/rhettinger'closed_at=<Date2010-08-08.01:33:17.550>created_at=<Date2008-12-07.01:10:10.246>labels= ['docs']
title='Bad example in set tutorial'updated_at=<Date2010-08-08.01:33:17.549>user='https://bugs.python.org/jmarter'
I see that the spelling of banana has been fixed but what is the purpose of assigning fruit and then immediately reassigning it another value without even looking at the first assignment?
>> fruit = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']
>> fruit = set(basket) # create a set without duplicates
Activity
jmarter commentedon Dec 7, 2008
On http://docs.python.org/3.0/tutorial/datastructures.html#sets there is
the following section in the section on sets
The third command should be an assignment to basket rather than fruit.
jmarter commentedon Dec 7, 2008
Also, I see banana is misspelled on the first output line (line 3).
rhettinger commentedon Dec 7, 2008
Fixed r67624.
jmarter commentedon Jan 24, 2010
I see that the spelling of banana has been fixed but what is the purpose of assigning fruit and then immediately reassigning it another value without even looking at the first assignment?
florentx commentedon Jan 24, 2010
Confirmed in trunk and 3.1
autometa commentedon Apr 6, 2010
Replaced unused variable assignment with a call to set() for illustrative purposes.
jmarter commentedon Apr 7, 2010
You may want to add another space before the comment, otherwise it will be the only one not aligned with the others.
l0nwlf commentedon Apr 7, 2010
I guess giving fruit, the set of unique fruit a different name makes it more clear. Comments alignment fixed.
autometa commentedon Apr 7, 2010
I think this change fits well with the rest of the example without having to rework things. Spacing fixed.
rhettinger commentedon Apr 7, 2010
I'll get to this soon.
rhettinger commentedon Aug 8, 2010
Fixed in r83809 and r83810.