Giter Club home page Giter Club logo

Comments (2)

dongweiming avatar dongweiming commented on May 18, 2024

@xiaomiba0904 这个问题挺好。对这个例子来说,这2种用法的效果是一样的,但是我一般不会在初始化的时候添加不必要的、需要执行的语句,而是在需要的时候才去执行。这算是一种我的编程习惯吧,因为可能大部分的初始化 并不需要知道self.path是什么,如果放在__init__里面,那么就是无差别的都要执行一次,然而实际上用不到

from web_develop.

xiaomiba0904 avatar xiaomiba0904 commented on May 18, 2024

谢谢解惑

from web_develop.

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.