Git Product home page Git Product logo

Comments (5)

gearmonkey avatar gearmonkey commented on July 30, 2024

The generator versus list issue in this issue is done for two reasons, though there are perhaps ways around both.

  1. memory footprints - this is really not a major issue, given the current size of charts, but if they're very large...
  2. response time - for current chart entities (artist) making a class instance doesn't call the api, but for others this may not be the case, suggesting a benefit to creating the object when used rather than when the chart is created.

Though now that I'm writing these reasons out, it occurs to me that this all may be adding up to a bit too much support for things that don't exist, since given the current calls I agree that a list comprehension makes more sense...

from mmpy.

atl avatar atl commented on July 30, 2024

I totally get where you're coming from, especially the ideas behind late binding for the purposes of reducing memory footprint and latency. In addition, I may only want the top 10 in a chart, and any other data is unnecessary (but note that I can't slice the generator anyway).

[So what we really need are Python closures, so that the Artist object instantiation can be late-bound instead of the list?]

Hum, I mostly brought it up to get at what you were thinking, and to advocate for dead-simple repeatability in a user-facing API.

from mmpy.

gearmonkey avatar gearmonkey commented on July 30, 2024

@atl :
[So what we really need are Python closures, so that the Artist object instantiation can be late-bound instead of the list?]

yes. I suppose the question then is which comprehension is a better approximation of what is desired, as a placeholder until such time as someone (probably me) can write something that looks a lot like closures...

from mmpy.

atl avatar atl commented on July 30, 2024

I was playing with some "how big is an Object" code in python, but calling vars() on a pre-API call Artist() shows how compact that object really is.

If you take a policy stand that other entities shall be as minimal as that (and hitting the API is a separate step), I'd place my vote for list comprehension.

from mmpy.

gearmonkey avatar gearmonkey commented on July 30, 2024

Alright, you've convinced me, until such time I (or some else) gets some proper closures in the charts class we'll change it over to a list comprehension, and to keep core entities small till you do something with them.

from mmpy.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.