Coder Social home page Coder Social logo

Comments (4)

ChristopherChudzicki avatar ChristopherChudzicki commented on June 2, 2024

We can check for variable--constant collisions and variable--variable collisions. I don't think we can check for constant--constant or function--function collisions without changing how constants and functions are declared because unlike variables, they are declared using dictionaries and Python dictionary literals permit duplicate keys and use the latest:

{
    'a': 5,
    'a': 10
} ==
{
    'a': 10
}
# True

Regarding

We've decided that users should be able to overwrite default constants and functions, however.

Another thing we could do is raise an error (ConfigCollisionError, or something) with a message like "ConfigCollisionError: Declaring variable 'i' will overwrite existing constant 'i'. To proceed anyway, add suppress_warnings=True to your grader configuration. Seems like it could be a useful pattern in other cases, too.

from mitx-grading-library.

jolyonb avatar jolyonb commented on June 2, 2024

Ah. Good point. Less work for us then! Let's just do variable-variable and variable-constant checks.

I'm happy to greenlight a warning message like that. Let's call it ConfigCollisionWarning. Putting in suppress_warnings=True will be annoying, but then again, that's kind of the point.

from mitx-grading-library.

ChristopherChudzicki avatar ChristopherChudzicki commented on June 2, 2024

Ok! I'll do it now.

from mitx-grading-library.

ChristopherChudzicki avatar ChristopherChudzicki commented on June 2, 2024

resolved by #53

from mitx-grading-library.

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.