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
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
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
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...
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
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
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
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
_
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.
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(
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
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
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
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
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
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
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
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
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
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.
--
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
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
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.
>
&
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:
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
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.
.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
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
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
__
'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.
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
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
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
___
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
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:
> >
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
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:
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
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
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.
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
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
__
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
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).
--
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
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
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
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
__
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
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
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
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
___
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
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
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
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
[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
57 matches
Mail list logo