Re: [Python-3000] Windows gui vs. console

2008-02-07 Thread Daniel Stutzbach
dow and you have to interact with that. Not a great user experience. Also, piping data to or from the script is impossible because stdin/stdout are tied to the new window. (I use Python for windows and pipe data to scripts everyday, so this is pretty important to me :-) ) I agree with Paul and Phillip

Re: [Python-3000] Nix dict.copy()

2008-02-10 Thread Daniel Stutzbach
If a class still defines both __copy__ and copy(), print a warning/error (this should be rare). If copy is called with arguments or defined with more than the "self" argument, make no change. If copy is defined with more than the "self" argument, but all the arguments

Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Daniel Stutzbach
Python can be copied--so I'm not sure new information a .copy() method conveys. Normally I might assume that it does a special kind of copying that doesn't fit the definition of copy.copy() nor copy.deepcopy(), except that for dict and set types, .copy() and .__copy__() are identical. -- D

Re: [Python-3000] Nix dict.copy()

2008-02-12 Thread Daniel Stutzbach
or a minute. Which types should have a .copy() method and why? If I'm making a new copyable type, is there a rule of thumb that helps me decide on .copy(), .__copy__(), or both? Rules of "dict and set have a .copy() method" or "mapping types have a .copy() method" seem...

Re: [Python-3000] adding gamma and error functions to math module

2008-07-15 Thread Daniel Stutzbach
rceware.org/cgi-bin/cvsweb.cgi/~checkout~/src/newlib/libm/math/s_erf.c?rev=1.1.1.1&cvsroot=src -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinf

Re: [Python-3000] adding gamma and error functions to math module

2008-07-16 Thread Daniel Stutzbach
On Wed, Jul 16, 2008 at 11:04 AM, nirinA raseliarison <[EMAIL PROTECTED]> wrote: > Daniel Stutzbach wrote: >> http://sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/src/newlib/libm/math/s_erf.c?rev=1.1.1.1&cvsroot=src > > a personnal view here. i'm always perplex when

Re: [Python-3000] adding gamma and error functions to math module

2008-07-21 Thread Daniel Stutzbach
Also, the patch doesn't include the extensive comments in the original code that explain the mathematics. Including a URL in the patch would at least allow someone to find those comments. Thanks again, -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC

Re: [Python-3000] Should len() clip to sys.maxsize or raise OverflowError?

2008-09-02 Thread Daniel Stutzbach
cry, "Oops, I've been caught". (I'm interested in this issue because my list-like extension type<http://stutzbachenterprises.com/blist>can in some cases have a length greater than sys.maxsize) -- Daniel Stutzbach, Ph.D. http://stutzbachenterprises.com _

Re: [Python-3000] Should len() clip to sys.maxsize or raiseOverflowError?

2008-09-02 Thread Daniel Stutzbach
range restriction (like we've done for > other int operations a long time ago). > +1 -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> ___ Python-3000 mailing list Python-3000@python.

Re: [Python-3000] None in Comparisons

2008-11-14 Thread Daniel Stutzbach
whatever type I'm dealing with. It's a bit of of a pain. My use cases are all along the following lines: class TimeSpan: def __init__(self): self.earliest = AlwaysGreatest self.latest = AlwaysLeast def update(self, v): self.earliest = min(

Re: [Python-3000] PEP Draft: Enhancing the buffer protcol

2007-02-27 Thread Daniel Stutzbach
aise an exception, but it would be nice to spell this out in the PEP. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/pytho

Re: [Python-3000] PEP Draft: Enhancing the buffer protcol

2007-02-27 Thread Daniel Stutzbach
nd. These could be subtypes of the PyArray type with very little trouble, and it would only be necessary to maintain one reference counter for them instead of two. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Pytho

Re: [Python-3000] Draft PEP for New IO system

2007-02-28 Thread Daniel Stutzbach
e RawIOBase object in an appropriate BufferIOBase object first. Then read() can be called with no argument and return as many bytes as are available. It sounds like you want to force RawIOBase objects to have a buffer, too, which defeats the point of having layers. Most use-cases will want to use a Bu

Re: [Python-3000] PEP Draft: Enhancing the buffer protcol

2007-02-28 Thread Daniel Stutzbach
its operation? I looked through the code, but didn't see anything to that effect (except with regard to weak reference objects). I can't see how anything other than the garbage collector would even find such an object. -- Daniel Stutzbach, Ph.D. President, Stutzbach En

Re: [Python-3000] Draft PEP for New IO system

2007-02-28 Thread Daniel Stutzbach
w > is this case handled? I checked how Python 2.5 handles this, and you're right. Read operations should continue to return 0 bytes if the user keeps trying to read at EOF. Not sure what I was thinking. -- Daniel Stutzbach, Ph.D. Pres

Re: [Python-3000] Draft PEP for New IO system

2007-02-28 Thread Daniel Stutzbach
Should FileIO objects define the following methods and properties that the Python 2 file object defines? mode name closed isatty Secondly, should any of these be bumped up to the Raw I/O ABC? -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC

Re: [Python-3000] Draft PEP for New IO system

2007-02-28 Thread Daniel Stutzbach
TED]> wrote: > Hi all, > > Daniel Stutzbach and I have prepared a draft PEP for the new IO system > for Python 3000. This document is, hopefully, true to the info that > Guido wrote on the whiteboards here at PyCon. This is still a draft > and there's quite a few decisions t

Re: [Python-3000] Draft PEP for New IO system

2007-03-01 Thread Daniel Stutzbach
blocking object, it would block until all data is written to the raw object). I prefer option #2 because a .flush() that doesn't flush is more surprising. The goal of supporting non-blocking file-like objects is to be able to use select() with buffered I/O objects (and other things like a

Re: [Python-3000] Thoughts on new I/O library and bytecode

2007-03-03 Thread Daniel Stutzbach
for the other format? repr(b) -> bytes("spam spam spam")' b.hex() -> "7370616d 20737061 6d207370 616d" -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@pyth

Re: [Python-3000] Draft PEP for New IO system

2007-03-04 Thread Daniel Stutzbach
ery reasonable. I suppose for an Text object wrapped around a socket, .readline() could be dangerous if a malicious peer sends a few gig all on one line. That's a problem for the encoding layer to sort out, not the buffering layer though. --

Re: [Python-3000] Draft PEP for New IO system

2007-03-04 Thread Daniel Stutzbach
cations current needs, but this can lead to strange failures later when the application needs to hold buffer_size+1 bytes in the buffer and suddenly dies. [1] = "reliable" in the sense of "no data loss unless the connection drops" -- Daniel Stutz

Re: [Python-3000] PEP: rename it.next() to it.__next__(), add a next() built-in

2007-03-06 Thread Daniel Stutzbach
ed somewhat in terms of return value checking. FWIW, PEP 234 states that the end of iteration can also be signaled by returning NULL without an exception set. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 m

Re: [Python-3000] Non-blocking I/O? (Draft PEP for New IO system)

2007-03-06 Thread Daniel Stutzbach
mode > > > rather than "push" mode. It's hard to see how this > > > could fit into the model as a minor variation on > > > how writes are done. > > > > Meaning it needs to be a distinct interface and explicitly designed as such. > &

Re: [Python-3000] Non-blocking I/O? (Draft PEP for New IO system)

2007-03-06 Thread Daniel Stutzbach
lly implies that the operation was rejected altogether. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe:

Re: [Python-3000] Non-blocking I/O? (Draft PEP for New IO system)

2007-03-07 Thread Daniel Stutzbach
ch, not work around it so that the problem is harder to detect. An object only becomes non-blocking if the program explicitly makes it non-blocking via fcntl. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mai

Re: [Python-3000] Proposed changes to PEP3101 advanced string formatting -- please discuss and vote!

2007-03-13 Thread Daniel Stutzbach
tionaries together to > build kwargs, but that can be ugly, tedious, and slow.) > Implementation-wise, this feature and locals() / globals() go hand in > hand. +1 I can think of many cases where it'd be nice to pass locals() along with some_row_from_SQL. -- Daniel Stutzbach, Ph.

Re: [Python-3000] Reversing through text files with the new IO library

2007-03-13 Thread Daniel Stutzbach
.readuntil() would also be incredibly useful for writing network protocol code when the protocol isn't line-based. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org

Re: [Python-3000] Reversing through text files with the new IO library

2007-03-13 Thread Daniel Stutzbach
oing any work on this at the moment, but feel free to fire me an email asking "Could you do X?". -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org http://mail.pyt

Re: [Python-3000] Fwd: Re: Fwd: Re: Fwd: Re: Octal

2007-03-15 Thread Daniel Stutzbach
The later is error-prone and might be hard to debug if you put too much faith in comments. However, I'd be happy with leaving out octal literals in favor of: x = int('755', 8) -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC __

Re: [Python-3000] Total ordering and __cmp__

2007-03-21 Thread Daniel Stutzbach
's just exposing what's there > at the C level anyway. I apologize if this is a silly question, but what would be the difference between the proposed __richcmp__ and the old __cmp__ that's being removed? -- Daniel Stutzbach, Ph.D.

[Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-23 Thread Daniel Stutzbach
st O(log n)). I recognize that the Python developer community is understandably very attached to the current array-based list, so I expect this to get shot down. I hope this doesn't reflect badly on the more modest proposal of including a new type in t

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-23 Thread Daniel Stutzbach
extension modules can continue to use it. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.pytho

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-23 Thread Daniel Stutzbach
lly exclusive but related suggestions: 1) Add BList to the standard library as part of the collections module (which I hope will be accepted), or 2) Replace list() with BList (which I expect to be rejected) -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-23 Thread Daniel Stutzbach
On 4/23/07, Josiah Carlson <[EMAIL PROTECTED]> wrote: > "Daniel Stutzbach" <[EMAIL PROTECTED]> wrote: > > On 4/23/07, Bill Janssen <[EMAIL PROTECTED]> wrote: > > > > Replace list() with the BList. > > > > > > Generally, I like the

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-23 Thread Daniel Stutzbach
On 4/23/07, Mike Klaas <[EMAIL PROTECTED]> wrote: > On 4/23/07, Daniel Stutzbach <[EMAIL PROTECTED]> wrote: > > So you can see the performance of the BList in more detail, I've made > > several performance graphs available at the following link: > >

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-23 Thread Daniel Stutzbach
age the copy-on-write feature, then BLists are *much* more memory efficient that regular lists. __getslice__ is probably the most commonly used function in this category. A slice of a large BList uses only O(log n) memory in the worst case. -- Daniel Stutzbach, Ph.D. President, Stutz

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-23 Thread Daniel Stutzbach
st of BList's item is visible in the right-hand graph via the step at n=128. The next step would be at n=16384. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org http:

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-24 Thread Daniel Stutzbach
On 4/23/07, Neal Norwitz <[EMAIL PROTECTED]> wrote: > On 4/23/07, Daniel Stutzbach <[EMAIL PROTECTED]> wrote: > > Replace list() with the BList. > > I looked over this patch and have various questions/comments. In > rough priority order: Thanks for taking the

Re: [Python-3000] Generic function PEP won't make it in time

2007-04-24 Thread Daniel Stutzbach
place for docstrings, so I like the existing proposal better (@abstract). -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-25 Thread Daniel Stutzbach
unity as a whole feels. > You've come a long way since then. Congrats. > > Thanks for your contribution and thoughtful discussion. This weekend, I look > forward to reading you source code in detail. Thanks! I've just adding my Python prototype implementation to the .tar.

Re: [Python-3000] Draft PEP: Dropping PyObject_HEAD

2007-04-28 Thread Daniel Stutzbach
To facilitate migration, I have a few suggestions: - add the new access macros to 2.6 (defined appropriately) - in 3.0, instead of removing PyObject_HEAD and company, redefine them appropriately, .e.g, #define PyObject_HEAD PyObject obtype; -- Daniel Stutzbach, Ph.D. President

Re: [Python-3000] Two proposals for a new list-like type: one modest, one radical

2007-04-30 Thread Daniel Stutzbach
s at the beginning of a block. - Use Py_ssize_t instead of int in all (I think) the appropriate places. - Cleaned up the debugging code to rely on fewer macros - Removed all (I think) gcc-isms -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC __

[Python-3000] BList PEP

2007-05-01 Thread Daniel Stutzbach
PEP: 30XX Title: BList: A faster list-like type Version: $Revision$ Last-Modified: $Date$ Author: Daniel Stutzbach <[EMAIL PROTECTED]> Discussions-To: Python 3000 List Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 30-Apr-2007 Python-Version: 2.6 and/or 3.0 Post-Histo

Re: [Python-3000] BList PEP

2007-05-01 Thread Daniel Stutzbach
On 5/1/07, Paul Moore <[EMAIL PROTECTED]> wrote: > > - Implement TimSort for BLists, so that best-case sorting is O(n) > > instead of O(log n). > > Is that a typo? Why would you want to make best-case sorting worse? Yes, it should read O(n log n), not O(log n). --

Re: [Python-3000] BList PEP

2007-05-01 Thread Daniel Stutzbach
On 5/1/07, Terry Reedy <[EMAIL PROTECTED]> wrote: > "Daniel Stutzbach" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | Sort O(n log n) O(n log n) > > Tim Peters' list.sort is, I believe, better than nlo

Re: [Python-3000] PEP 3132: Extended Iterable Unpacking

2007-05-04 Thread Daniel Stutzbach
returns. A list will return a list, a tuple will return a tuple, and widgets (or BLists...) can return whatever makes sense for them. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@py

Re: [Python-3000] new io (pep 3116)

2007-05-07 Thread Daniel Stutzbach
can use send(), recv(), and getpeername(). > TCP sockets make no use of sendto(). and even with > TCP sockets, listeners never use send() or recv(), while connected > sockets never use listen() or connect(). Agreed. -- Daniel Stutzbach, Ph.D. Preside

Re: [Python-3000] PEP 3132: Extended Iterable Unpacking

2007-05-07 Thread Daniel Stutzbach
turn lists - tuples return tuples - XYZ containers return XYZ containers - non-container iterables return iterators. It's a consistent rule, albeit a different consistent rule than always returning the same type. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC __

Re: [Python-3000] PEPs update

2007-05-11 Thread Daniel Stutzbach
idioms that I wanted to use that were just not practical with an array-based list. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-300

Re: [Python-3000] PEPs update

2007-05-11 Thread Daniel Stutzbach
t were just not practical with an array-based list. > > We ought to set up a page on the wiki for success stories with blist as a > third-party module. In time, the Right Answer (tm) will become self-evident. I haven't used the python.org wiki before. If you point me to the right pla

Re: [Python-3000] Support for PEP 3131

2007-05-14 Thread Daniel Stutzbach
ive tongue is not based on Latin characters (notably Yukihiro Matsumoto's Ruby). -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo

Re: [Python-3000] BLists (PEP 3128)

2007-05-28 Thread Daniel Stutzbach
e that is taken care of, I get back to looking at performance. However, I'm leaving tomorrow for 3 weeks (wedding + honeymoon), so I'm not going to be able to make any further progress until I get back. :-) -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___

Re: [Python-3000] On PEP 3116: new I/O base classes

2007-06-20 Thread Daniel Stutzbach
e of bytes. Characters may be multi-byte. It is no longer an ASCII world. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/p

Re: [Python-3000] On PEP 3116: new I/O base classes

2007-06-20 Thread Daniel Stutzbach
not? If so, how would the later be different from the RawIOBase and BufferedIOBase classes, already described in the PEP? I'm not sure I 100% understand what you mean by "normalization policy" (Q). Could you give an example? -- Daniel Stutzbach, Ph.D. President, Stutzba

Re: [Python-3000] On PEP 3116: new I/O base classes

2007-06-21 Thread Daniel Stutzbach
he return type as opaque might also reduce the temptation to do perform arithmetic on them, which will work for some codecs (ASCII), but break later in odd ways for others. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC ___ P

Re: [Python-3000] print() flushing problem.

2007-11-07 Thread Daniel Stutzbach
ams that do a lot of writing to standard output (especially if standard output is a pipe). Tangent: If standard output is a pipe and not a tty, is P3K smart enough to switch to fully-buffered mode instead of line-buffered mode? -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprise

Re: [Python-3000] Possible Duck Typing Problem in Python 2.5?

2007-12-09 Thread Daniel Stutzbach
[1,2,3] > print l + x > > fails with > > TypeError: can only concatenate list (not "instance") to list > > If you want class X to understand "+" via duck-typing, overload __add__ and __radd__. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises