This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients jacobidiego, mark.dickinson
Date 2010-07-10.19:51:21
SpamBayes Score 0.0013581449
Marked as misclassified No
Message-id <1278791483.84.0.924913856563.issue9218@psf.upfronthosting.co.za>
In-reply-to
Content
The python-ideas mailing list might be a better place to discuss this.  Note that it's too late for new features in the 2.x series, so I'm changing the version to 3.2

> pop self.recv_buffer[:size]

I don't think this'll fly, even if you spell it pop(self.recv_buffer[:size]).  It's not worth a new built-in function, let alone a grammar change.

> self.recv_buffer.pop(,-size)

Something like this seems more reasonable, especially if it can be done without introducing new syntax and in a fully backwards-compatible way.

One idea that seems fairly natural to me would be to allow list.pop and friends to support slices, so you could do:

  last2 = slice(None, -2)
  self.recv_buffer.pop(last2)

or even

  penultimate, ultimate = self.recv_buffer.pop(last2)

It would require some work to implement and debug this, though.
History
Date User Action Args
2010-07-10 19:51:23mark.dickinsonsetrecipients: + mark.dickinson, jacobidiego
2010-07-10 19:51:23mark.dickinsonsetmessageid: <1278791483.84.0.924913856563.issue9218@psf.upfronthosting.co.za>
2010-07-10 19:51:22mark.dickinsonlinkissue9218 messages
2010-07-10 19:51:22mark.dickinsoncreate