Ticket #2323 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

support deque in objgrep

Reported by: glyph Owned by: therve
Priority: highest Milestone:
Component: core Keywords:
Cc: Branch:
Author: Launchpad Bug:

Description

This is an outgrowth of #1134, but maybe it would be useful on its own.

Attachments

test_reflect_2323.diff Download (3.4 KB) - added by therve 4 years ago.

Change History

Changed 4 years ago by glyph

Committed to branch dqog-2323.

Changed 4 years ago by glyph

  • owner changed from glyph to thomasvs

At the very least, testDeque should be test_deque and have a docstring. Are there any arguments against adding this though? I personally can't think of any.

Changed 4 years ago by glyph

  • owner changed from thomasvs to therve

Changed 4 years ago by therve

I'd to use a bit of duck-typing here to test list-like objects and not rely on isinstance.

Changed 4 years ago by exarkun

You really need to do type checking here because that's the only way to be certain you are correctly accounting for references.

Unless you do something entirely different instead.

I'd like to see something based on gc.get_referents(), since that will work for pretty much any type.

Changed 4 years ago by therve

Changed 4 years ago by therve

  • priority changed from normal to highest
  • keywords review added
  • owner therve deleted

Added a few docstring, and change method names to conform new standard. The patch is against the branch.

Changed 4 years ago by exarkun

(In [19486]) apply patch attached to ticket

Refs #2323

Changed 4 years ago by exarkun

  • keywords review removed
  • owner set to therve

Might be nice to update the types.ListType and types.TupleType on the changed line in reflect.py to just be list and tuple.

Changes all look good. Make the above change if you want, and merge.

Changed 4 years ago by therve

  • status changed from new to closed
  • resolution set to fixed

(In [19490]) Merge dqog-2323

Author: therve Reviewer: exarkun Fixes #2323

Add support for deque in reflect.objgrep.

Note: See TracTickets for help on using tickets.