Re: [Python-ideas] "Immutable Builder" Pattern and Operator

2017-01-23 Thread breamoreboy
On Monday, January 23, 2017 at 2:11:53 PM UTC, M.-A. Lemburg wrote: > On 23.01.2017 14:28, Soni L. wrote: > > > > > > On 23/01/17 11:18 AM, M.-A. Lemburg wrote: > >> On 23.01.2017 14:05, Soni L. wrote: > >>> Yeah but the dotequals operator has many other benefits: > >>> > >>> long_name .= __call_

Re: [Python-ideas] "Immutable Builder" Pattern and Operator

2017-01-23 Thread M.-A. Lemburg
On 23.01.2017 14:28, Soni L. wrote: > > > On 23/01/17 11:18 AM, M.-A. Lemburg wrote: >> On 23.01.2017 14:05, Soni L. wrote: >>> Yeah but the dotequals operator has many other benefits: >>> >>> long_name .= __call__ # cast to callable >>> long_name .= wrapped # unwrap >>> etc >>> >>> And it also

Re: Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-13 Thread Stefan Behnel
Phlip, 07.01.2010 17:44: On Jan 7, 5:36 am, Stefan Behnel wrote: Well, then note that there are tons of ways to generate XML with Python, including the one I pointed you to. from lxml.html import builder as E xml = E.foo() All I want is "", but I get "AttributeError: 'module

Re: Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-07 Thread Stephen Hansen
On Thu, Jan 7, 2010 at 8:44 AM, Phlip wrote: > On Jan 7, 5:36 am, Stefan Behnel wrote: > > > Well, then note that there are tons of ways to generate XML with Python, > > including the one I pointed you to. > > from lxml.html import builder as E >xml = E.foo() > > All I want is ""

Re: Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-07 Thread Phlip
#x27;module' object has no attribute 'foo'". A peek at dir(E) shows it only has HTML tags, all hard coded. So how to get it to generate any random XML tag my clients think of? I will write this myself with __getattr__ etc, if I can't find it, because the permissive &

Re: Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-07 Thread Stefan Behnel
Phlip, 05.01.2010 18:00: On Jan 5, 12:16 am, Stefan Behnel wrote: Note that there are tons of ways to generate HTML with Python. Forgot to note - I'm generating schematic XML, and I'm trying to find a way better than the Django template I started with! Well, then note that there are tons o

Re: Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-05 Thread Phlip
On Jan 5, 12:16 am, Stefan Behnel wrote: > Note that there are tons of ways to generate HTML with Python. Forgot to note - I'm generating schematic XML, and I'm trying to find a way better than the Django template I started with! -- http://mail.python.org/mailman/listinfo/python-list

Re: Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-05 Thread Stefan Behnel
Phlip, 04.01.2010 21:01: Not Hyp: I hope I'm wrong, but seems that DOMBuilder, found among the various xml.dom packages, cannot build DOM like this: var html = DomBuilder.apply(); var form = html.FORM( html.DIV( html.INPUT({type : 'text', name : 'email'}), html.INPUT({type : 'text

Where's a DOM builder that uses the Builder Pattern to ... build DOMs?

2010-01-04 Thread Phlip
Not Hyp: I hope I'm wrong, but seems that DOMBuilder, found among the various xml.dom packages, cannot build DOM like this: var html = DomBuilder.apply(); var form = html.FORM( html.DIV( html.INPUT({type : 'text', name : 'email'}), html.INPUT({type : 'text', name : 'password'}),

Re: Builder Pattern

2006-02-02 Thread Peter Otten
> I have converted another example of strategy which I prefer to the 2 > described earlier, here it is: > > class FindMinima: > def algorithm(self):raise NotImplementedError When most of your code does nothing in a pompous way that is a sure sign that you are heading in the wrong directio

Re: Builder Pattern

2006-02-02 Thread Jason
I have converted another example of strategy which I prefer to the 2 described earlier, here it is: class FindMinima: def algorithm(self):raise NotImplementedError class LeastSquares (FindMinima): def algorithm(self,line): return (1.1,2.2) class NewtonsMethod (F

Re: Builder Pattern

2006-01-29 Thread Paddy
> What the following discussion says is that the C++ -> Python > transliteration is totally trivial and obvious and berates the original > requestor for making me waste 10 minutes to provide it. Thanks for the giggle :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Builder Pattern

2006-01-28 Thread Alex Martelli
Jason <[EMAIL PROTECTED]> wrote: > Hi > > I really need an example of a builder pattern in python, the closest I > could find to something resembling builder was on this thread... > http://groups.google.co.uk/group/it.comp.lang.python/browse_thread/threa d/44f79c1def2583ca

Builder Pattern

2006-01-28 Thread Jason
Hi I really need an example of a builder pattern in python, the closest I could find to something resembling builder was on this thread... http://groups.google.co.uk/group/it.comp.lang.python/browse_thread/thread/44f79c1def2583ca/200adefeefa5f3fa?lnk=st&q=design+pattern+builder+python+-build&