Re: [Tutor] basic decorator question

2017-08-03 Thread Steven D'Aprano
Sorry for the delay in responding to this thread! On Wed, Jul 26, 2017 at 09:22:59PM -0500, boB Stepp wrote: > I am having a recurring problem with Python: I can work out the > mechanics of how various Python constructs work, such as decorators, > but then I find myself scratching my head as to

Re: [Tutor] basic decorator question

2017-07-27 Thread Alan Gauld via Tutor
On 27/07/17 03:22, boB Stepp wrote: > use them. The idea of replacing a function with its decorated version > sounds cool, but what types of problems would I want to use this > approach on? I'm sure others will have their own take on this but personally I view them as primarily for building

Re: [Tutor] basic decorator question

2017-07-26 Thread boB Stepp
On Mon, Jul 24, 2017 at 11:01 AM, Steven D'Aprano wrote: > > There's more to decorators than that, but hopefully that will > demonstrate some of the basic concepts. Feel free to ask any more > questions on the mailing list, and we will answer if we can. > I hope I can ask

Re: [Tutor] basic decorator question

2017-07-24 Thread Peter Otten
bruce wrote: > Hi. > > I've seen sites discuss decorators, as functions that "wrap" and > return functions. > > But, I'm sooo confuzed! My real question though, can a decorator have > multiple internal functions? All the examples I've seen so far have a > single internal function. > > And, if

Re: [Tutor] basic decorator question

2017-07-24 Thread Steven D'Aprano
Hi Bruce, On Mon, Jul 24, 2017 at 10:33:25AM -0400, bruce wrote: > Hi. > > I've seen sites discuss decorators, as functions that "wrap" and > return functions. > > But, I'm sooo confuzed! My real question though, can a decorator have > multiple internal functions? All the examples I've seen so

Re: [Tutor] basic decorator question

2017-07-24 Thread Mats Wichmann
On 07/24/2017 08:33 AM, bruce wrote: > Hi. > > I've seen sites discuss decorators, as functions that "wrap" and > return functions. > > But, I'm sooo confuzed! My real question though, can a decorator have > multiple internal functions? All the examples I've seen so far have a > single internal

[Tutor] basic decorator question

2017-07-24 Thread bruce
Hi. I've seen sites discuss decorators, as functions that "wrap" and return functions. But, I'm sooo confuzed! My real question though, can a decorator have multiple internal functions? All the examples I've seen so far have a single internal function. And, if a decorator can have multiple