adriank / ObjectPath

The agile query language for semi-structured data
http://objectpath.org
MIT License
380 stars 93 forks source link

Use chain.from_iterable in interpreter.py #100

Closed cool-RR closed 4 years ago

cool-RR commented 4 years ago

This is a faster and more idiomatic way of using itertools.chain. Instead of computing all the items in the iterable and storing them in memory, they are computed one-by-one and never stored as a huge list. This can save on both runtime and memory space.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 89.557% when pulling d5e68a44a7fb4ca0dbaffc057c1e214b6764284a on cool-RR:patch-2 into aa475004bc22fe8f477227974fceb28537ddff67 on adriank:master.

adriank commented 4 years ago

Thanks, I believe it's a new addition to the language. Will check if it works well on test cases in all supported versions of python.

On Wed, 17 Jun 2020 at 12:46 Coveralls notifications@github.com wrote:

[image: Coverage Status] https://coveralls.io/builds/31508079

Coverage remained the same at 89.557% when pulling d5e68a4 https://github.com/adriank/ObjectPath/commit/d5e68a44a7fb4ca0dbaffc057c1e214b6764284a on cool-RR:patch-2 into aa47500 https://github.com/adriank/ObjectPath/commit/aa475004bc22fe8f477227974fceb28537ddff67 on adriank:master.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adriank/ObjectPath/pull/100#issuecomment-645299433, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABLE4V3NXESOWIROJSAKQTRXCNH3ANCNFSM4OAPEFPQ .

-- Greetings, Adrian Kalbarczyk

https://kalbarczyk.co | https://devyard.io

cool-RR commented 4 years ago

It's not new, it's supported since Python 2.6. You're welcome :)

On Wed, Jun 17, 2020 at 2:54 PM Adrian Kalbarczyk notifications@github.com wrote:

Thanks, I believe it's a new addition to the language. Will check if it works well on test cases in all supported versions of python.

On Wed, 17 Jun 2020 at 12:46 Coveralls notifications@github.com wrote:

[image: Coverage Status] https://coveralls.io/builds/31508079

Coverage remained the same at 89.557% when pulling *d5e68a4 < https://github.com/adriank/ObjectPath/commit/d5e68a44a7fb4ca0dbaffc057c1e214b6764284a

on cool-RR:patch-2 into aa47500 < https://github.com/adriank/ObjectPath/commit/aa475004bc22fe8f477227974fceb28537ddff67

on adriank:master*.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adriank/ObjectPath/pull/100#issuecomment-645299433, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AABLE4V3NXESOWIROJSAKQTRXCNH3ANCNFSM4OAPEFPQ

.

-- Greetings, Adrian Kalbarczyk

https://kalbarczyk.co | https://devyard.io

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adriank/ObjectPath/pull/100#issuecomment-645328327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN3SVYV2GL3DCIKLB2DCDRXCVG5ANCNFSM4OAPEFPQ .

cool-RR commented 4 years ago

@adriank Any conclusions? Anything on Python 2.6 or above would very likely work the same.

adriank commented 4 years ago

Didn't have time yet.

On Sun, 21 Jun 2020 at 16:35 Ram Rachum notifications@github.com wrote:

@adriank https://github.com/adriank Any conclusions? Anything on Python 2.6 or above would very likely work the same.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/adriank/ObjectPath/pull/100#issuecomment-647136408, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABLE4TVTADFI5ZMAVT4IODRXYLD7ANCNFSM4OAPEFPQ .

-- Greetings, Adrian Kalbarczyk

https://kalbarczyk.co | https://devyard.io