Message198871
>
> I don't like "_ex" suffixes, it's not future proof if we need to add
> another function later.
>
Me neither, but you can't change a function that returns a list of 4-tuples
into a function that returns a list of 5-tuples without breaking existing
code. IIRC for struct and time tuples we created a hack in C where we
return something that behaves like an N-tuple but has some extra attributes
-- but I don't think collections.namedtuple supports that.
> You may rename them using "_iter" suffix and return an iterator instead of
> a list.
I already thought of that, but that doesn't work: the iterator version
would return the stack in the wrong order (note the .reverse() call in the
code).
> Such idea was also proposed for os.listdir() => os.scandir() /
> os.iterdir(). See the discussion in #11406. The caller can write
> tuple(extract_stack_iter()), as I do with dict.items() to sort a dictionary.
>
> I like unit tests :-) The patch should also document new functions.
>
I'll take care of that when we've agreed on the new API.
> You may only need the most recent frames.
>
Not sure what you mean by that. |
|
Date |
User |
Action |
Args |
2013-10-02 20:41:00 | gvanrossum | set | recipients:
+ gvanrossum, akuchling, vstinner, benjamin.peterson, Claudiu.Popa, serhiy.storchaka |
2013-10-02 20:41:00 | gvanrossum | link | issue19146 messages |
2013-10-02 20:41:00 | gvanrossum | create | |
|