dcwatson / bbcode

A pure python bbcode parser and formatter.
BSD 2-Clause "Simplified" License
68 stars 17 forks source link

Adding a linker_reentrant option to bbcode.Parser. This allows thread s... #12

Closed pythonesque closed 10 years ago

pythonesque commented 10 years ago

...afe use of a user defined linker with context.

This is what I was discussing in issue #11. It's basically just pulled straight from the changes I made in my own project, plus a test.

dcwatson commented 10 years ago

I think my only gripe with this is the name of the flag -- passing an extra parameter to the linker has nothing to do with reentrancy (in this case). I'd probably call it something more obvious like linker_takes_context.

dcwatson commented 10 years ago

I should qualify that last comment -- it could be related to reentrancy if you're mutating global state in your linker function and using the module in a multi-threaded environment, but I doubt that's the norm.

pythonesque commented 10 years ago

Fair enough, resubmitted (though if you want to go with the reflection variant that's cool too).

dcwatson commented 10 years ago

Thanks. Fix the test case (looks like just a missed rename), and I'll go ahead and merge it.

pythonesque commented 10 years ago

Done :)