philipbl / python-persistent-queue

A persistent queue for Python
9 stars 4 forks source link

Inline function and statements? #1

Closed Kriechi closed 8 years ago

Kriechi commented 8 years ago

Hi,

I was reading through the code - all quite nice and clean. However I stumbled upon this pieces - any I'm curios about your design decision here:

https://github.com/philipbl/python-persistent-queue/blob/294677f5ca795cb9446f9bb41bc1b4db14386663/persistent_queue/__init__.py#L234-L236 https://github.com/philipbl/python-persistent-queue/blob/294677f5ca795cb9446f9bb41bc1b4db14386663/persistent_queue/__init__.py#L259-L264

Why are these separate functions, not just a block within the for-loops, since they do not return anything?

philipbl commented 8 years ago

I like how it looks. You can read through the main logic of the function without having to worry about the details of those functions. Also, it mirrors the _peek function. But I could go either way -- it's just how I felt the day that I wrote it.