From: Ben W. <da...@gm...> - 2008-11-06 15:57:40
|
I'll have to check what I did with this last. I vaguely remember running into a 2.3 problem, and thought I had it solved. :-) Can you tell I've been out of the loop again? However, I would say that my primary goal was to offer an elegant way to add new markups. I care less about Treap being the implementation than an elegant, pythonic solution. :) So, no bruised ego here. At least the conversation has started. That said, let me check when I get home on what I did on this. I remember there being a problem, but not if it's the same as encountered with 2.3 incompatibility. Entirely possible that I made a personal decision not to care. I've not been able to visit the issue in quite some time. However, OrderedDict looks very familiar. I should say (I think I did once before) that my original inspiration was from PmWiki, which is PHP-based. The author of that tool created a wiki framework where everything could be overridden. The markup was very flexible. Having grown accustomed to that flexibility, I'd wanted to see it here. Regards, Ben On Tue, Oct 28, 2008 at 3:13 AM, Yuri Takhteyev <qar...@gm...> wrote: > I haven't had a chance to play with this, but in principle this looks > reasonable. I suggest that you merge this into mainline and let's > assume that this is our solution for now. I'll try to think a little > more about it next week. > > No offense to Ben - his library looked great. But it probably does > makes more sense to go with a more standard solution. Ben: if you > think we are making a mistake here, please speak up. :) > > - yuri > > On Wed, Oct 22, 2008 at 9:01 PM, Waylan Limberg <wa...@gm...> wrote: >> I just pushed a new branch "dj-odict" [1] that implements a working >> OrderedDict. You should see the last 2 commits in that branch. The >> first of the 2 was an incomplete (it works but there is more work to >> do) implementation of voidspace's OrderedDict with a few additional >> methods. However, as that implementation included a lot of features >> we'll never need (like comparison operators), I switched to the much >> simpler Django implementation and improved the added methods. I've >> reimplemented the ``add`` and ``link`` methods and they work with the >> ``_begin``, ``_end``, ``<key``, and ``>key`` syntax. While they are >> not necessary, it does make the code in the extension shorter and to >> the point. The tests in regression_tests.py cover the features we need >> pretty well. I still need to write documentation, but that can wait >> until I know we're going to go with this. >> >> I didn't do any real performance/memory usage testing, but the >> regression_tests consistently run a little faster with more tests so >> I'm thinking we have a minimal speed increase with this. >> >> Personally, I like it. >> >> As an aside, note the change in the tables.py extension in that last >> commit. I had to do that to get the test to pass. Thing is, is was >> passing with Treap and it shouldn't have been because Treap was >> getting the order wrong (I think - I haven't actually checked this). I >> know it was getting the order wrong on footnotes for sure, but that >> ext doesn't have tests so it didn't show up. There are still some >> other, unrelated problems with footnotes though, so they aren't >> working right now (I think I broke them when I refactored the >> processors/patterns this past weekend). But there wasn't much point in >> working on that when things weren't in the right order so I did this >> first. >> >> [1]: http://gitorious.org/projects/python-markdown/repos/mainline/logs/dj-odict >> >> On Wed, Oct 22, 2008 at 12:53 PM, Yuri Takhteyev <qar...@gm...> wrote: >>>> Apparently Treap wasn't tested in Python 2.3 as the builtin function >>>> ``sorted`` (as well as ``operator.itemgetter`` which sorted needs) are >>>> not available until 2.4. We get errors on import. Can't even try >>>> running the code. >>> >>> I did test it with 2.3, discovered that it wasn't working, but thought >>> that this would be fixable, so this has been on my todo list. >>> >>>> Personally, I'd prefer dropping Treap for an OrderedDict. odict [1] >>> >>> We can definitely think about this. I'll have to read up on odict to >>> see if it does everything that we need. Of top of my head, though, >>> odict 1400 lines, too big to just include in our code, so we would >>> have to worry about an extra dependency. But let's think about this. >>> Perhaps we should look at more options too. >>> >>> - yuri >>> >>> -- >>> http://sputnik.freewisdom.org/ >>> >> >> >> >> -- >> ---- >> Waylan Limberg >> wa...@gm... >> > > > > -- > http://sputnik.freewisdom.org/ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Python-markdown-discuss mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss > -- Ben Wilson "Words are the only thing which will last forever" Churchill |