[issue35118] Add peek() or first() method in queue

2021-03-16 Thread Alexey Volkov
Alexey Volkov added the comment: >Why not just dismiss older queue entries during a normal get() operation? Or >just use a plain deque with access guarded by a lock. You do not know whether the item needs to be removed until you see it. And to see it you need to get it. And if y

[issue35118] Add peek() or first() method in queue

2021-03-05 Thread Alexey Volkov
Alexey Volkov added the comment: >For Queue, I'm not sure I've ever seen any use case for peek. What do you >have in mind? I want to examine the first (oldest) element in queue and remove it if it's too old. The queue should not be modified unless the oldest element is t

[issue12920] inspect.getsource only works for objects loaded from files, not interactive session

2020-11-29 Thread Alexey Volkov
Alexey Volkov added the comment: This is also an issue even for non-interactive scenarios: When doing `python -c ''` inspect.getsource does not work and there are no stack traces. Perhaps this case will be easier to fix? -- nosy: +Ark-kun