Re: [Python-Dev] tree data structure and python

2005-03-26 Thread Skip Montanaro

vivek> I have to implement tree data structure using python. How it can
vivek> be done in python.

Wrong list.  This is about development *of* Python, not development *with*
Python.  Try python-list@python.org (or its sister Usenet newsgroup,
comp.lang.python) instead.

-- 
Skip Montanaro
[EMAIL PROTECTED]
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] FYI: news items about Burton Report on P-languages

2005-03-26 Thread Guido van Rossum
-- Forwarded message --
From: Google Alerts <[EMAIL PROTECTED]>
Date: Fri, 25 Mar 2005 15:36:32 -0800 (PST)
Subject: Google Alert - python -spamalot -monty
To: [EMAIL PROTECTED]


Google Alert for: python -spamalot -monty



Report: P-Languages Better For Enterprise
InternetNews.com - USA
PHP (define), Perl (define), and Python (define) (the P-Languages)
have really come into their own over the last four or five years
because of their ability to ...
See all stories on this topic

Perl, Python and PHP get the nod for Enterprise.
HTML FIX IT.COM - Grand Rapids,MI,USA
Perl Python and PHP are all Open Source programming languages and
there is a ton of free software written in all of those languages
available online. ...


Report: P-Languages Better For Enterprise (InternetNews)
ACM Queue - New York,NY,USA
PHP, Perl and Python are mission-critical ready and more effective
than C++, Java, and C# in some scripting scenarios, according to
Burton Group. ...




 This once a day Google Alert is brought to you by Google.

 Remove this alert. 
Create another alert.
Manage your alerts.









 

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] @decoration of classes

2005-03-26 Thread Eric Nieuwland
Given the ideas so far, would it possible to:
def meta(cls):
...
@meta
class X(...):
...
??
--eric
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] @decoration of classes

2005-03-26 Thread Josiah Carlson

Eric Nieuwland <[EMAIL PROTECTED]> wrote:
> 
> Given the ideas so far, would it possible to:
> 
> def meta(cls):
>   ...
> 
> @meta
> class X(...):
>   ...

It is not implemented in Python 2.4.  From what I understand, making it
happen in Python 2.5 would not be terribly difficult.  The question is
about a "compelling use case".  Is there a use where this syntax is
significantly better, easier, etc., than an equivalent metaclass?  Would
people use the above syntax if it were available?

What would you use the above syntax to do?


 - Josiah

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] @decoration of classes

2005-03-26 Thread Eric Nieuwland
On 26 mrt 2005, at 21:36, Josiah Carlson wrote:
Eric Nieuwland <[EMAIL PROTECTED]> wrote:
Given the ideas so far, would it possible to:
def meta(cls):
...
@meta
class X(...):
...
It is not implemented in Python 2.4.  From what I understand, making it
happen in Python 2.5 would not be terribly difficult.  The question is
about a "compelling use case".  Is there a use where this syntax is
significantly better, easier, etc., than an equivalent metaclass?  
Would
people use the above syntax if it were available?

What would you use the above syntax to do?
Well, I can imagine using
@meta(MyMetaClass)
class MyClass(...):
...
instead of
class MyClass(...):
__metaclass__ = MyMetaClass
...
Somehow, it seems more aesthetic to me.
--eric
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] @decoration of classes

2005-03-26 Thread Jp Calderone
On Sat, 26 Mar 2005 22:49:33 +0100, Eric Nieuwland <[EMAIL PROTECTED]> wrote:
>On 26 mrt 2005, at 21:36, Josiah Carlson wrote:
> > Eric Nieuwland <[EMAIL PROTECTED]> wrote:
> >> Given the ideas so far, would it possible to:
> >>
> >> def meta(cls):
> >>...
> >>
> >> @meta
> >> class X(...):
> >>...
> >
> > It is not implemented in Python 2.4.  From what I understand, making it
> > happen in Python 2.5 would not be terribly difficult.  The question is
> > about a "compelling use case".  Is there a use where this syntax is
> > significantly better, easier, etc., than an equivalent metaclass?  
> > Would
> > people use the above syntax if it were available?
> >
> > What would you use the above syntax to do?
> 
> Well, I can imagine using
> 
> @meta(MyMetaClass)
> class MyClass(...):
>   ...
> 
> instead of
> 
> class MyClass(...):
>   __metaclass__ = MyMetaClass
>   ...
> 
> Somehow, it seems more aesthetic to me.

  This doesn't quite work the same, though.  The former creates a new instance 
of ClassType, then (presumably) rips it apart and passes the pieces to 
MyMetaClass.

  The latter just passes the pieces to MyMetaClass unassembled.

  I can imagine cases where the class creation would fail during the first step 
of the former process, so I don't think this is actually a use-case for class 
decorators.

  Jp
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com