Re: Decorators, Identity functions and execution...

2006-04-12 Thread Dave Hansen
On Wed, 12 Apr 2006 17:19:25 +1200 in comp.lang.python, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, > "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >>"Sybren Stuvel" <[EMAIL PROTECTED]> wrote in >> > I don't care about how people see my tabs. I use one tab for ever

Re: Decorators, Identity functions and execution...

2006-04-12 Thread Peter Hansen
Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > "Ben Sizer" <[EMAIL PROTECTED]> wrote: >>Every day I come across people or programs that use tab stops every 2 >>or 8 columns. I am another fan of tabs every 4 columns, but >>unfortunately this isn't standard, so spaces in Python it is

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote: >"Sybren Stuvel" <[EMAIL PROTECTED]> wrote in > > I don't care about how people see my tabs. I use one tab for every >> indent level, so no matter how you set your tab width, my code will >> look consistent. > >Unless they v

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Ben Sizer" <[EMAIL PROTECTED]> wrote: >Lawrence D'Oliveiro wrote: >> In article <[EMAIL PROTECTED]>, >> "Carl Banks" <[EMAIL PROTECTED]> wrote: >> >> >Always use spaces when posting, and use them in your code as well. >> >Spaces are the current recommended practi

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Terry Reedy
"Sybren Stuvel" <[EMAIL PROTECTED]> wrote in > I don't care about how people see my tabs. I use one tab for every > indent level, so no matter how you set your tab width, my code will > look consistent. Unless they view with tab_width = 0, as with some news readers. tjr -- http://mail.pyth

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Sybren Stuvel
Ben Sizer enlightened us with: > Every day I come across people or programs that use tab stops every > 2 or 8 columns. I am another fan of tabs every 4 columns, but > unfortunately this isn't standard, so spaces in Python it is. I don't care about how people see my tabs. I use one tab for every in

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Ben Sizer
Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > "Carl Banks" <[EMAIL PROTECTED]> wrote: > > >Always use spaces when posting, and use them in your code as well. > >Spaces are the current recommended practice, and in the future tabs > >might become illegal. I'd prefer tabs myself, bu

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Christos Georgiou
On Tue, 11 Apr 2006 15:05:22 +1200, rumours say that Lawrence D'Oliveiro <[EMAIL PROTECTED]> might have written: >In article <[EMAIL PROTECTED]>, > Roy Smith <[EMAIL PROTECTED]> wrote: > >>One of the most basic >>maxims on the Internet has always been, "Be liberal in what you accept, be >>conser

Re: Decorators, Identity functions and execution...

2006-04-10 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Roy Smith <[EMAIL PROTECTED]> wrote: >One of the most basic >maxims on the Internet has always been, "Be liberal in what you accept, be >conservative in what you produce". How do you explain top-posting, then? -- http://mail.python.org/mailman/listinfo/python-l

Re: Decorators, Identity functions and execution...

2006-04-10 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Carl Banks" <[EMAIL PROTECTED]> wrote: >Always use spaces when posting, and use them in your code as well. >Spaces are the current recommended practice, and in the future tabs >might become illegal. I'd prefer tabs myself, but it's more important >to respect comm

Re: Decorators, Identity functions and execution...

2006-04-10 Thread Christos Georgiou
On Sun, 09 Apr 2006 11:42:34 -0300, rumours say that Jorge Godoy <[EMAIL PROTECTED]> might have written: >Indeed. This is correct. Fredrick's comment was related to the lack of >indentation in your code. His code was indented fine, as you maybe noticed later on. The actual problem was that he

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Carl Banks
Steven D'Aprano wrote: > On Sun, 09 Apr 2006 08:52:18 -0700, Carl Banks wrote: > > > it's more important > > to respect community standards than to stick to some silly preference > > you have. > > What happens when the community standard is a silly preference? I object > to the suggestion that "c

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Carl Banks
Felipe Almeida Lessa wrote: > Em Dom, 2006-04-09 às 08:52 -0700, Carl Banks escreveu: > > You've made the unfortunate mistake of indenting it with tabs, which > > do > > not show up on some newsreaders. I see the tabs in Google; people > > using Microsoft Outlook do not. > > He does not need to k

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Felipe Almeida Lessa
Em Dom, 2006-04-09 às 08:52 -0700, Carl Banks escreveu: > You've made the unfortunate mistake of indenting it with tabs, which > do > not show up on some newsreaders. I see the tabs in Google; people > using Microsoft Outlook do not. He does not need to know that some poor designed newsreaders m

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Roy Smith
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 09 Apr 2006 08:52:18 -0700, Carl Banks wrote: > > > it's more important > > to respect community standards than to stick to some silly preference > > you have. > > What happens when the community standard is a silly preference? I object > to t

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Steven D'Aprano
On Sun, 09 Apr 2006 08:52:18 -0700, Carl Banks wrote: > it's more important > to respect community standards than to stick to some silly preference > you have. What happens when the community standard is a silly preference? I object to the suggestion that "community standards" (that is, a standar

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Fredrik Lundh
Carl Banks wrote: > Having said that, this decorator will not affect calling overhead at > all. The decorator is applied when the module is loaded, not when the > decorated function is called. to be precise, the decorator is applied when the "def" statement is exe- cuted (that is, when the decor

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Chance Ginger
First, thanks for the tip of 'tabs'. I keep forgetting Outlook has some interesting rules about displaying text. Thanks for the comment about happening at load time. That resolved the problem (in my thinking)! I don't believe I have an issue at all... Peace, CG. On Sun, 09 Apr 2006 08:52:18 -070

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Carl Banks
Chance Ginger wrote: > On Sun, 09 Apr 2006 09:51:18 +0200, Fredrik Lundh wrote: > > > Chance Ginger" wrote: > > > >> If I define a decorator like: > >> > >> def t(x) : > >> def I(x) : return x > >> return I > > > > ... you get a syntax error. > > > > It isn't a syntax error...I tried it before I p

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Fredrik Lundh
Chance Ginger wrote: > It isn't a syntax error...I tried it before I posted. In fact > def t(x) : > def I(x) : return x > return I > > is correct. tabs don't make it through all channels. don't use tabs for indentation when you post to newsgroups or mailing lists. and @(Y) is not valid Python s

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Jorge Godoy
Chance Ginger <[EMAIL PROTECTED]> writes: > On Sun, 09 Apr 2006 09:51:18 +0200, Fredrik Lundh wrote: > >> Chance Ginger" wrote: >> >>> If I define a decorator like: >>> >>> def t(x) : >>> def I(x) : return x >>> return I >> >> ... you get a syntax error. >> > > It isn't a syntax error...I tried

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Chance Ginger
On Sun, 09 Apr 2006 09:51:18 +0200, Fredrik Lundh wrote: > Chance Ginger" wrote: > >> If I define a decorator like: >> >> def t(x) : >> def I(x) : return x >> return I > > ... you get a syntax error. > It isn't a syntax error...I tried it before I posted. In fact def t(x) : def I(x) :

Re: Decorators, Identity functions and execution...

2006-04-09 Thread Fredrik Lundh
Chance Ginger" wrote: > If I define a decorator like: > > def t(x) : > def I(x) : return x > return I ... you get a syntax error. > and use it like: > > @t(X) > def foo(a) : > # definition of foo... > pass that's also a syntax error. > or maybe this: > > @t(X) > @(Y) > def bar(a) : > # The def