Re: [Python-ideas] Problems (and solutions?) in writing decorators

2019-03-14 Thread Sylvain MARIE via Python-ideas
Thanks David Sorry for not getting back to you earlier, I made a bunch of releases of makefun in the meantime. In particular I fixed a few bugs and added an equivalent of `functools.partial` . > One of the nice things in wrapt is that Dumpleton lets you use the same > decorator for functions,

Re: [Python-ideas] Code version evolver

2019-03-14 Thread francismb
Hi Steven, On 3/12/19 12:25 AM, Steven D'Aprano wrote: > I don't know who you expect is using this: the Python core developers > responsible for adding new language features and changing the grammar, > or Python programmers. Python core devs should write the 'python_next' and 'is_python_code' part

Re: [Python-ideas] Code version evolver

2019-03-14 Thread Chris Angelico
On Fri, Mar 15, 2019 at 7:39 AM francismb wrote: > > Hi Steven, > > On 3/12/19 12:25 AM, Steven D'Aprano wrote: > > I don't know who you expect is using this: the Python core developers > > responsible for adding new language features and changing the grammar, > > or Python programmers. > Python c

Re: [Python-ideas] Code version evolver

2019-03-14 Thread francismb
Hi Paul, On 3/12/19 12:21 AM, Paul Moore wrote: > That sounds very similar to 2to3, which seemed like a good approach to > the Python 2 to Python 3 transition, but fell into disuse because > people who have to support multiple versions of Python in their code > found it *far* easier to do so with

[Python-ideas] HTML Wrapper

2019-03-14 Thread Vlad Tudorache
Hello, I'd like to know if there is a basic HTML wrapper for Python, like TextWrapper but allowing the generation of HTML from strings or iterables of strings. Like: make_select = HTMLWrapper(tag='select class="eggs"', indent=' ') make_option = HTMLWrapper(tag='option') Applying this like: s =

Re: [Python-ideas] HTML Wrapper

2019-03-14 Thread Steven D'Aprano
Hi Vlad, and welcome! On Thu, Mar 14, 2019 at 10:00:03PM +0100, Vlad Tudorache wrote: > Hello, > > I'd like to know if there is a basic HTML wrapper for Python, like > TextWrapper but allowing the generation of HTML from strings or iterables > of strings. This list is for proposing and discussin

Re: [Python-ideas] Code version evolver

2019-03-14 Thread Steven D'Aprano
On Thu, Mar 14, 2019 at 09:33:21PM +0100, francismb wrote: [...] > > Do you mean something like 2to3? Something which transforms source code > > written in Python? > > > Yes a source transformer, but to be applied to some 3.x version to move > it to the next 3.x+1, and so on ... (instead of '2to3'

Re: [Python-ideas] Code version evolver

2019-03-14 Thread Stephen J. Turnbull
francismb writes: > Trying to keep a single code base for 2/3 seems like a good idea > (may be the developer just cannot change to 3 fast due how big the > step was) but that also have the limitation on how far you can go > using new features. This doesn't work very well: you can't use 3 at a

Re: [Python-ideas] Problems (and solutions?) in writing decorators

2019-03-14 Thread Stephen J. Turnbull
Sylvain MARIE via Python-ideas writes: > I totally understand your point of view. However on the other hand, > many very popular open source projects out there have the opposite > point of view and provide decorators that can seamlessly be used > with and without arguments (pytest, attrs, clic

Re: [Python-ideas] Code version evolver

2019-03-14 Thread Greg Ewing
francismb wrote: Yes a source transformer, but to be applied to some 3.x version to move it to the next 3.x+1, and so on ... (instead of '2to3' a kind of 'nowtonext', aka 'python_next') Couldn't that relax the tension on doing 'backward compatibility changes' a bit ? Not really. Having to tran

Re: [Python-ideas] HTML Wrapper

2019-03-14 Thread Christopher Barker
This is very much the kind of thing that would belong in a library. There's probably more than one out there right now. In fact, way back when I started learning Python (almost 20 yrs ago!)), there was such a lib -- I think it was called HTMLgen. However, since then, most people have decided that

Re: [Python-ideas] HTML Wrapper

2019-03-14 Thread Vlad Tudorache
Hello, Steven, This wasn't a question asking for support. The answers I found when searching were different from what I needed, that's why I'm using my own. But I understand the point. Regards, Vlad Le jeu. 14 mars 2019 à 23:43, Steven D'Aprano a écrit : > Hi Vlad, and welcome! > > On Thu, M