473,379 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

PEP 318 - PyFIT comments

Decorator syntax seems to have been checked into 2.4b2.
I'm not going to comment on the syntax other than to say
that, when there isn't a real obvious syntax, someone has
to make a decision, and this one should work.

I was originally against it, on the basis that the only
use cases I saw were the elimination of the staticmethod()
and classmethod() builtin functions. I've used them, and
they're not ideal, but something like decorators for that
one use case seems to be going after a fly with a
howitzer.

Andrew Kuchling's comments here:
http://www.amk.ca/diary/archives/cat_python.html#003255
and especially the comments he quotes from Jim Hugunin
got me to thinking again about it. I can't quite see what
Thomas Heller is getting at with ctypes, though.

My current interest is in PyFIT. It's a Python
port of Ward Cunningham's FIT acceptance
testing program (fit.c2.com). I had to add a general
metadata mechanism to it to make it work cleanly
(the original port by Simon Michael tried to use
RExec, which obviously no longer works as well
as having major ambiguity problems.) There's an
early release in the download section at

http://www.xprogramming.com/software.htm

The current releases are in the files section of the
Extremeprogramming and the Fitnesse Yahoo mailing
lists.

When I looked at the metadata problem, I really
wanted a mechanism that would allow me to attach
metadata to any object in the class object. I can
do that to function objects, but I also need to do
it to properties and more general objects (such
as strings and integers.)

This doesn't, unfortunately, allow me to do that.

John Roth
Jul 18 '05 #1
7 1467
>>>>> "John" == John Roth <ne********@jhrothjr.com> writes:

John> Decorator syntax seems to have been checked into 2.4b2. I'm
John> not going to comment on the syntax other than to say that,
John> when there isn't a real obvious syntax, someone has to make
John> a decision, and this one should work.

Yes, it should work. It's also a terrible waste of @ punctuation,
which should IMO be reserved for some more worthwhile purpose. I was
eagerly waiting for the introduction of decorators (and worried that
the proposed syntaxes would cause the feature to be thrown out), but
this choice of syntax leaves a bad taste in my mouth, and makes me
want to see the intro of decorators to be postponed or scrapped
altogether.

This syntax is out there with backticks and print>>. And I'm one of
those who voted *for* ternary operator, and generally embrace new
features with enthusiasm.

--
Ville Vainio http://tinyurl.com/2prnb
Jul 18 '05 #2
On Wednesday 04 August 2004 14:11, Ville Vainio wrote:
Yes, it should work. It's also a terrible waste of @ punctuation,
which should IMO be reserved for some more worthwhile purpose.


I'd concur with that... I saw the decorator syntax and thought "what is
this thing? and why is it in Python?"

When I read about decorators in the What's New guide, the first syntax
that jumped to my mind was:

def(staticmethod) somemethod(self, args):
some code

This was before reading the PEP or seeing any other recommendations for
syntax (except the nested-block syntax mentioned in another thread,
which I don't like either; it seems to not fit the nature of
decorations very well).

-Michael
Jul 18 '05 #3
Ville Vainio <vi***@spammers.com> writes:
This syntax is out there with backticks and print>>.


I agree.

I just don't know where else to voice my opinion on this matter, but I
absolutely hate the new decorator syntax. Sorry, I just had to get
that off my chest.

Nick

--
# sigmask || 0.2 || 20030107 || public domain || feed this to a python
print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?')
Jul 18 '05 #4
On 4 Aug 2004, Nick Vargish wrote:
I just don't know where else to voice my opinion on this matter, but I
absolutely hate the new decorator syntax.


I wish PEPs had a method through which votes could be cast, for or against
the PEP (or parts of it), not unlike Bugzilla bugs. At least then we'd
have an easier and more organized way to give the BDFL some democratic
input. Either way, I really wish he would hold off on decorators until
there's a consensus on them, rather than forcing them in amidst all the
disagreements surrounding them.

Jul 18 '05 #5

On 4-aug-04, at 21:35, Nick Vargish wrote:
Ville Vainio <vi***@spammers.com> writes:
This syntax is out there with backticks and print>>.


I agree.

I just don't know where else to voice my opinion on this matter, but I
absolutely hate the new decorator syntax. Sorry, I just had to get
that off my chest.


Why do you dislike it?

Ronald

Jul 18 '05 #6
Ronald Oussoren wrote:

On 4-aug-04, at 21:35, Nick Vargish wrote:
Ville Vainio <vi***@spammers.com> writes:
This syntax is out there with backticks and print>>.

I agree.

I just don't know where else to voice my opinion on this matter, but I
absolutely hate the new decorator syntax. Sorry, I just had to get
that off my chest.

Why do you dislike it?

Ronald


I think for the same reason as me!

I dislike it because it introduces a new punctuation character as an
operator for a relatively esoteric task. At least using a keyword
instead of @ would be a good idea.

Readability counts.

David
Jul 18 '05 #7
Ronald Oussoren <ro************@mac.com> writes:
Why do you dislike it?


It has a negative impact on readability.

It's ugly.

It modifies a declaration outside the declaration.

It feels unpythonic.

Of course these are subjective responses, and my weighting of the
importance of these complaints may not match yours. From the comments
in this newsgroup, I don't have the feeling that I'm alone in some or
all of these criticisms.

Nick

--
# sigmask || 0.2 || 20030107 || public domain || feed this to a python
print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?')
Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: lkrubner | last post by:
I've got a PHP application that's 2 megs in size. Of that, my guess is 200k-400k is comments. Do they impose a performance hit? I've been postponing any kind of optimization, but at some point I'll...
4
by: Uwe Ziegenhagen | last post by:
Hello, my fellows and me implement a c++ tool that is able to divide blank/tab separated files into <number>, <text>, <c-singlelinecomment> and <multilinecomment>. So far it's not working bad,...
28
by: Benjamin Niemann | last post by:
Hello, I've been just investigating IE conditional comments - hiding things from non-IE/Win browsers is easy, but I wanted to know, if it's possible to hide code from IE/Win browsers. I found...
40
by: Edward Elliott | last post by:
At the risk of flogging a dead horse, I'm wondering why Python doesn't have any multiline comments. One can abuse triple-quotes for that purpose, but that's obviously not what it's for and doesn't...
7
by: Bob Stearns | last post by:
Several weeks ago I asked what comments I could pass to DB2 in a SELECT statement. I don't remember whether I said via PHP/ODBC. I was assured that both /* */ style comment blocks and -- comment...
98
by: tjb | last post by:
I often see code like this: /// <summary> /// Removes a node. /// </summary> /// <param name="node">The node to remove.</param> public void RemoveNode(Node node) { <...> }
40
by: jacob navia | last post by:
Recently we had poor Mr "teapot" that was horrified at the heresy of lcc-win of accepting // comments. C is a nice language, and you can do anything with it, inclusive a program that transforms...
4
by: oakley | last post by:
I was wanting to experiment with PyFIT but it seems DOA. Googling doesn't yield any information less than two years old. When I try to install 0.8a2 I get errors because setup.py references a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.