Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nikoder/PySON
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: nikoder/PySON
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: BunchAlternatives
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jan 27, 2014

  1. Caught in between the difficulties of both cleanly and simply support…

    …ing a common interface between a simple decentant of object and a more useful custom class (simple bunch vs. PysonBunch). Abandoning this effort for now, until a situation arises where it is actually definitley useful to have a "SimpleBunch".
    nikoder committed Jan 27, 2014
    Configuration menu
    Copy the full SHA
    05a922e View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2014

  1. Option 2:

    Just inherit from dict.
    Advantage: No object breakage due to name collisions, when storing in the dict.
    Disadvantage: Dict introduces new name pollution with names which you may well want to use in PySON, such as the name "update".
    (not a polished solution, just for history)
    
    Keeping this in a commit, but planning to move on to Option 3: Inherit from dict, but rename the members via a metaclass, adding a configurable prefix, so that collisions can be easily avoided per application.
    nikoder committed Jan 30, 2014
    Configuration menu
    Copy the full SHA
    bfa7a7a View commit details
    Browse the repository at this point in the history
  2. It works... Thanks to major meta-hackery. The advantage of this imple…

    …mentation of bunches is that you can support an *approximate* dict interface and (the following part is not yet implemented) redirect user values to a separate dict, which should allow preventing any ill side-effects which might arise from name collisions between PySON names and python dict/object names.
    
    This whole thing does not appear to be necessary on cpython, however, since the python interpreter does not seem to get upset by those name collisions (it looks up special properties on the class, rather than the instance) and user code still receives whatever value may have overriden a built-in name. Thus this branch will be left to collect dust, at least for now.
    nikoder committed Jan 30, 2014
    Configuration menu
    Copy the full SHA
    313db0b View commit details
    Browse the repository at this point in the history
Loading