Coder Social home page Coder Social logo

dictmerge's People

Contributors

galenchurch avatar toejough avatar

Watchers

 avatar

Forkers

galenchurch

dictmerge's Issues

rename the 'create_rule' function

'create' is misleading - this is really a 'set' function, as it's also the function used to override an already created rule.

suggest 'set_rule' and 'unset_rule' instead of 'create/delete'.

Make the Merge API naming more self-consistent

currently there are inconsistent names for the API:

  • set/delete rule (not set/unset or create/delete?)
  • define/remove type (not define/undefine or add/remove?)

consider updating the API to be:

  • create/delete rule
  • define/undefine type

generator will cause merge to hang

A generator will be converted to a tuple right now. If it's an infinite generator, it will cause the merge to hang forever. Generators should be caught and treated as scalars when doing a default merge, because it's not possible to know the correct behavior and account for it generically in the default library.

Just use python types

After reflection, while I like the idea of true duck typing, this should not be the default. The rest of python doesn't work that way. The special typing thing could stick around, but make the default be idiomatic python.

Add ability to extend for custom types

What if a user wants to actually combine strings? Or generators? Or custom merge functions for a custom class?

After implementing #1, make it possible to add custom merge functions to the Merge class (as distinct from just overriding existing functions/assignments).

Add some reasonable non-default merge functions

It's reasonable for someone to want a dictionary merge that throws an exception when there are conflicts, or a set merge that does an intersection instead of a union, or a string merge that merges strings, or a generic iterable merge-to-list, or a generic iterable merge-to-set, etc.

Provide these in some sort of 'extras' struct or package, and maybe provide a few pre-customized Merge classes/functions.

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.