Re: Python types

2006-03-24 Thread Steven Bethard
Salvatore wrote: > I've read several articles where it's said that Python is weakly typed. > I'm a little surprised. All objects seem to have a perfectly defined > type Hoping to head off another debate: http://wiki.python.org/moin/StrongVsWeakTyping STeVe -- http://mail.python.org/mailman/

Re: pondering about the essence of types in python

2006-03-25 Thread Steven Bethard
gangesmaster wrote: > but __mro__ is a readonly attribute, and deriving from instances is > impossible (conn.modules.wx.Frame is a PROXY to the class)... Maybe I'm misunderstanding, but why is an instance a proxy to a class? Why don't you make a class a proxy to the class? STeVe -- http://mail.

Re: pondering about the essence of types in python

2006-03-26 Thread Steven Bethard
gangesmaster wrote: > i dont think it's possible, to create proxy classes, but even if i did, > calling remote methods with a `self` that is not an instance of the > remote class would blow up. I don't understand you here. Why can't you just do something like: >>> class RemoteClass(object): ...

Re: maximum() efficency

2006-03-26 Thread Steven Bethard
Steve R. Hastings wrote: > I was looking at a Python function to find the maximum from a list. > The original was more complicated; I simplified it. The built-in max() > function can replace the simplified example, but not the original. What's the original? Are you sure max can't solve it with

Re: New-style Python icons

2006-03-26 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Personally, I *like* the new website look, and I'm glad to see Python > having a proper logo at last! > > I've taken the opportunity to knock up some icons using it, finally > banishing the poor old standard-VGA-palette snake from my desktop. If > you like, you can grab

Re: maximum() efficency

2006-03-26 Thread Steven Bethard
Steve R. Hastings wrote: > On Sun, 26 Mar 2006 10:34:16 -0700, Steven Bethard wrote: >> What's the original? > > def minimum(cmp, lst): > """minimum(cmp, lst) > > Returns the minimal element in non-empty list LST with elements > compared via

Re: New-style Python icons

2006-03-27 Thread Steven Bethard
Robin Becker wrote: > Steven Bethard wrote: > ... >>> >>> http://www.doxdesk.com/img/software/py/icons.zip >> >> I just wanted to say that I've been using these icons for almost a >> week now and I love them! I'd like to reiterate Eu

pre-PEP: The create statement

2006-04-05 Thread Steven Bethard
rsion: $Revision: 1.4 $ Last-Modified: $Date: 2003/09/22 04:51:50 $ Author: Steven Bethard <[EMAIL PROTECTED]> Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 05-Apr-2006 Python-Version: 2.6 Post-History: 05-Apr-2006 Abstract This PEP proposes a generalization o

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Michael Ekstrand wrote: > Something it could be useful to try to add, if possible: So far, it > seems that this create block can only create class-like things (objects > with a name, potentially bases, and a namespace). Is there a natural way > to extend this to other things, so that function creat

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Tim N. van der Leeuw wrote: > Could this still make it in Python 2.5 even? If it's pushed hard > enough? I don't know if this has been discussed on the python-dev > mailing lists and what the reactions of python-devs and GvR was? Unlikely. I haven't posted it to python-dev yet, and they've basical

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Carl Banks wrote: > Steven Bethard wrote: >> This PEP proposes a generalization of the class-declaration syntax, >> the ``create`` statement. The proposed syntax and semantics parallel >> the syntax for class definition, and so:: >> >> create : >>

updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
r variety of callables; the latter keeps a better parallel with the class statement. PEP: XXX Title: The create statement Version: $Revision: 1.4 $ Last-Modified: $Date: 2003/09/22 04:51:50 $ Author: Steven Bethard <[EMAIL PROTECTED]> Status: Draft Type: Standards Track Content-Type: text/

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Michele Simionato wrote: > Carl Banks wrote: >>> create module mod: >>> "This creates a sub-module named mod with an f1 function" >>> >>> def f1(): >>> ... >> Let's not do this, really. A module should be one-to-one with a file, >> and you should be able to impo

Re: updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Michele Simionato wrote: > Steven Bethard wrote: >> I've updated the PEP based on a number of comments on comp.lang.python. >> The most updated versions are still at: >> >> http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt >>

Re: updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Steven Bethard wrote: > I've updated the PEP based on a number of comments on comp.lang.python. > The most updated versions are still at: > > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.ht

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Terry Reedy wrote: > "Michele Simionato" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> This is a very relevant question. I would expect the new keyword would >> break lots >> of modules. However measuring is better than speculating. > > Please run also with alternatives, such a

Re: updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
; Steven> ... > > Steven> However, this would probably add some complexity in the grammar > Steven> and so far I (Steven Bethard) have not been able to implement > Steven> the feature without the keyword. > > Someone mentioned using "make&

Re: updated pre-PEP: The create statement

2006-04-07 Thread Steven Bethard
Carl Banks wrote: > Steven Bethard wrote: >> I've updated the PEP based on a number of comments on comp.lang.python. >> The most updated versions are still at: >> >> http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt >>

Re: Python 3.0 or Python 3000?

2006-04-09 Thread Steven Bethard
John Salerno wrote: > Is 'Python 3000' just a code name for version 3.0, or will it really be > called that when it's released? Actually, there's an official response these days in `PEP 3000`_: """ Naming Python 3000, Python 3.0 and Py3K are all names for the same thing. The project is called

Re: updated pre-PEP: The create statement

2006-04-10 Thread Steven Bethard
Azolex wrote: > Steven Bethard wrote: >> and named, nested hierarchies like XML documents could be created >> like:: >> >> create ETobject html: >> "This statement would generate an ElementTree object" >> >>

Re: updated pre-PEP: The create statement

2006-04-11 Thread Steven Bethard
Michele Simionato wrote: > Peter Hansen wrote: >> Michele Simionato wrote: >> > You can pull out the example in the official >>> PEP, if you like. >> Please do. If this is supposed to have anything to do with namespaces, >> it has nothing to do with the type of data structures XML is capable of >

Re: list.clear() missing?!?

2006-04-11 Thread Steven Bethard
Ville Vainio wrote: > I tried to clear a list today (which I do rather rarely, considering > that just doing l = [] works most of the time) and was shocked, SHOCKED > to notice that there is no clear() method. Dicts have it, sets have it, > why do lists have to be second class citizens? This gets

Re: pre-PEP: The create statement

2006-04-11 Thread Steven Bethard
John J. Lee wrote: > "Michele Simionato" <[EMAIL PROTECTED]> writes: > [...] >> This agrees with my scan (except I also found an occurrence of 'create' >> in Tkinter). >> BTW, I would be curious to see the script you are using for the >> scanning. Are you >> using tokenize too? In am quite fond of

Re: list.clear() missing?!?

2006-04-12 Thread Steven Bethard
Steven D'Aprano wrote: > On Tue, 11 Apr 2006 14:49:04 -0700, Ville Vainio wrote: > >> John Salerno wrote: >> >>> Thanks guys, your explanations are really helpful. I think what had me >>> confused at first was my understanding of what L[:] does on either side >>> of the assignment operator. On the

Re: list.clear() missing?!?

2006-04-12 Thread Steven Bethard
John Salerno wrote: > Steven Bethard wrote: > >> I think these are all good reasons for adding a clear method, but >> being that it has been so hotly contended in the past, I don't think >> it will get added without a PEP. Anyone out there willing to take out &

Re: list.clear() missing?!?

2006-04-13 Thread Steven Bethard
Raymond Hettinger wrote: > [Steven Bethard] >> I think these are all good reasons for adding a clear method, but being >> that it has been so hotly contended in the past, I don't think it will >> get added without a PEP. Anyone out there willing to take out the best &g

PEP 359: The "make" Statement

2006-04-13 Thread Steven Bethard
st-Modified: $Date: 2006-04-13 07:36:24 -0600 (Thu, 13 Apr 2006) $ Author: Steven Bethard <[EMAIL PROTECTED]> Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 05-Apr-2006 Python-Version: 2.6 Post-History: 05-Apr-2006, 06-Apr-2006 Abstract This PEP proposes a gen

Re: namespace issue

2006-04-13 Thread Steven Bethard
Daniel Nogradi wrote: > I would like to give the same name to a keyword argument of a class > method as the name of a function, with the function and the class > living in the same namespace and the class method using the > aforementioned function. So far I've been unsuccesfully trying to go > alon

Re: PEP 359: The "make" Statement

2006-04-14 Thread Steven Bethard
Nicolas Fleury wrote: > Steven Bethard wrote: >> Ok, I finally have a PEP number. Here's the most updated version of >> the "make" statement PEP. I'll be posting it shortly to python-dev. >> >> Thanks again for the previous discussion and sugges

Re: PEP 359: The "make" Statement

2006-04-14 Thread Steven Bethard
Duncan Booth wrote: > Steven Bethard wrote: > >> Should users of the make statement be able to determine in which dict >> object the code is executed? The make statement could look for a >> ``__make_dict__`` attribute and call it to allow things like:: >

Re: PEP 359: The "make" Statement

2006-04-14 Thread Steven Bethard
Steven Bethard wrote: > Duncan Booth wrote: >> Steven Bethard wrote: >> >>> Should users of the make statement be able to determine in which dict >>> object the code is executed? The make statement could look for a >>> ``__make_dict__``

">>>" and "..." (WAS PEP 359: The "make" Statement)

2006-04-14 Thread Steven Bethard
Felipe Almeida Lessa wrote: > Em Sex, 2006-04-14 às 09:31 -0600, Steven Bethard escreveu: >> [1] Here's the code I used to test it. >> >> >>> def make(callable, name, args, block_string): >> ... try: >> ... make_dict = callable.

Re: PEP 359: The "make" Statement

2006-04-14 Thread Steven Bethard
Rob Williscroft wrote: > Steven Bethard wrote in news:[EMAIL PROTECTED] > in comp.lang.python: > >> Open Issues >> === >> >> Does the ``make`` keyword break too much code? Originally, the make >> statement used the keyword ``create`` (a sugge

Re: PEP 359: The "make" Statement

2006-04-14 Thread Steven Bethard
Tim Hochberg wrote: > Steven Bethard wrote: >> Steven Bethard wrote: >>> Duncan Booth wrote: >>>> make Element html: >>>>make Element body: >>>>make Element p: >>>>text('But this ') >>>>

Re: PEP 359: The "make" Statement

2006-04-14 Thread Steven Bethard
Steven Bethard wrote: > Tim Hochberg wrote: >> Steven Bethard wrote: >>> Steven Bethard wrote: >>>> Duncan Booth wrote: >>>>> make Element html: >>>>>make Element body: >>>>>make Element

Re: PEP 359: The "make" Statement

2006-04-16 Thread Steven Bethard
Tim Hochberg wrote: > Tim Hochberg wrote: >> I don't think that's correct. I think that with a suitably designed >> HtmlDocument object, the following should be possible: >> >> with HtmlDocument("Title") as doc: >> with doc.element("body"): >>doc.text("before first h1") >>with

[ANN] argparse 1.1 - Command-line parsing library

2010-03-01 Thread Steven Bethard
=== Announcing argparse 1.1 === The argparse module provides an easy, declarative interface for creating command line tools, which knows how to: * parse the arguments and flags from sys.argv * convert arg strings into objects for your program * format and

[ANN] argparse 1.0.1 - Command-line parsing library

2009-09-14 Thread Steven Bethard
= Announcing argparse 1.0.1 = The argparse module provides an easy, declarative interface for creating command line tools, which knows how to: * parse the arguments and flags from sys.argv * convert arg strings into objects for your program * forma

<    11   12   13   14   15   16