Git Product home page Git Product logo

Comments (1)

monomonedula avatar monomonedula commented on May 31, 2024

The descriptors approach wasn't considered at the time of writing this library mostly because I wasn't an active user of the descriptors in general.

The idea seems kinda nice indeed. However there's a number of things to be considered if we are to implement this approach.

  • The use of descriptors will effectively make all fields optional for the class constructor. What I mean is something like this wouldn't be detected as a problem by the type checker anymore:
user = User()    # creating a user with no arguments
  • How do we implement the descriptors for fields with compound values (objects and arrays)?
  • Naming logic must be addressed too, since field name collision is possible (consider having two fields named foo and _foo in a model)

Could you also provide an example of a descriptor for some type that would actually require a conversion from/to JSON, as opposed to int?

from nvelope.

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.