Coder Social home page Coder Social logo

Argument 'ignore' is mutable about gae-init HOT 7 CLOSED

gae-init avatar gae-init commented on July 25, 2024
Argument 'ignore' is mutable

from gae-init.

Comments (7)

gmist avatar gmist commented on July 25, 2024

and one more thing - argument list shadows built-in list

from gae-init.

lipis avatar lipis commented on July 25, 2024

Nice ones :) the list should become is_list and as for the ignore I just wanted to indicate that it's a list.. what's the best approach to that?

from gae-init.

gmist avatar gmist commented on July 25, 2024

docstring + raise ValueError if type(ignore) not list - 100% bulletproof approach :)

from gae-init.

lipis avatar lipis commented on July 25, 2024

or maybe for the ignore we could accept comma separated strings or a list and by default set it to None and then inside the function something like this:

ignore = ignore.split(',') if isinstance(ignore, str) else ignore or []

from gae-init.

gmist avatar gmist commented on July 25, 2024

ignore is not changed in function, may just be use tuple ignore=()?

from gae-init.

lipis avatar lipis commented on July 25, 2024

With the above line it could be a tuple as well.. it's just in most cases it will be one argument.. is it too ugly to be able to accept anything and handle it inside the function?! Is stupid to have a comma in the argument name anyway (if at all possible)

from gae-init.

gmist avatar gmist commented on July 25, 2024

I agree, comma splitting string and ignore=None by default - it is the more elegant decision.

from gae-init.

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.