Code Monkey home page Code Monkey logo

Comments (9)

kvnkho avatar kvnkho commented on May 23, 2024 2

This content is good! Thanks for writing more advanced content.

from eugeneyan-comments.

xinofekuator avatar xinofekuator commented on May 23, 2024 1

That said, is there a reason not to use relative imports? Please comment below!

Regarding relative imports vs absolute imports I find this StackOverflow answer quite useful.

I personally prefer the absolute imports syntax, but it might be just due to been used to it. Rearrange the structure of the packages is not that hard using an IDE to refactor the imports. Regarding the modules inside packages issue, I personally dislike having modules inside packages instead of having them installable with pip. What would be a case where having modules inside a package would be preferred to publish it in pypi (either public or private)?

from eugeneyan-comments.

xinofekuator avatar xinofekuator commented on May 23, 2024 1

Thanks a lot of the content, very interesting details that are not widely known. Most of the things were new to me.

The latter states that it’s better to have a simple but slightly incomplete solution than a comprehensive but hard-to-maintain design.

100% agree. As a developer is sometimes hard to remove your own code complexity, I guess that is where working in teams and doing PR reviews gets handy as it is easy to suggest removing not needed complexity in some other's code I think.

from eugeneyan-comments.

vocdex avatar vocdex commented on May 23, 2024 1

Thanks for the content! I just needed to read this today

from eugeneyan-comments.

siddheshmhatre avatar siddheshmhatre commented on May 23, 2024 1

Thanks for this blog, super informative!

In this section is there a reason why you used relative imports in the models example

from .tree import DecisionTree, RandomForest
from .bandit import Bandit, TSBandit

and not in the app example?

from model_implementation import SimpleModel
from data_implementation import SimpleDataLoader

from eugeneyan-comments.

eugeneyan avatar eugeneyan commented on May 23, 2024 1

@siddheshmhatre Good point—updated!

from eugeneyan-comments.

eugeneyan avatar eugeneyan commented on May 23, 2024 1

@xinofekuator

What would be a case where having modules inside a package would be preferred to publish it in pypi (either public or private)?

In this case, I'm referring to .py files in packages as modules which may not be reusable by the public and thus not worth the effort to publish to pypi.

from eugeneyan-comments.

kvnkho avatar kvnkho commented on May 23, 2024 1

@eugeneyan I don't know if this is of interest to you, but James Lamb (a maintainer of LightGBM) talked about why we shouldn't publish tests/artifacts/etc. in SciPy here. A bit expected, but going into the numbers helps give insight to the problems end users face.

from eugeneyan-comments.

jkbellew avatar jkbellew commented on May 23, 2024

Hey I really enjoyed this content. Keep up the good work. I came for the first paragraph about Using super() in base classes and was able to follow along and understand by playing with the sample code. Keep that up I would have liked to have done the same thing with When to Use a Mixin.

from eugeneyan-comments.

Related Issues (20)

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.