Python Forum
a suggestion for a feature change
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a suggestion for a feature change
#1
mutable sequences have a method called pop that can be optionally given one argument to use as the index, else 0 is used.  the indexed element of the mutable sequence is the return value and is removed from the sequence.

my suggestion is to make it work much like the same name method of a mapping/dictionary.  allow a 2nd argument which will be the default value if the sequence is too short to be indexed by the given index.  by using a 2nd argument, no exception is raised, and the 2nd argument, the default value, is returned, when the index value is >= the length of the sequence.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
a suggestion for a feature change - by Skaperen - Jul-30-2017, 08:26 AM
RE: a suggestion for a feature change - by Larz60+ - Jul-30-2017, 03:19 PM
RE: a suggestion for a feature change - by DeaD_EyE - Jul-30-2017, 04:19 PM
RE: a suggestion for a feature change - by Skaperen - Jul-31-2017, 02:56 AM
RE: a suggestion for a feature change - by nilamo - Aug-02-2017, 09:06 PM
RE: a suggestion for a feature change - by Skaperen - Aug-03-2017, 07:09 AM
RE: a suggestion for a feature change - by DeaD_EyE - Aug-03-2017, 08:19 AM
RE: a suggestion for a feature change - by Skaperen - Aug-04-2017, 03:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IDE suggestion JackMack118 5 3,314 Nov-21-2019, 11:35 PM
Last Post: JackMack118
  Need Suggestion for a Good Python IDE Aprogrammer 6 4,094 Aug-14-2018, 02:22 PM
Last Post: Aprogrammer

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020