ect, without introducing far more overhead than
you're trying to eliminate.
> Then there are thread-specific reference counters for each object.
What happens when a new thread comes into existence? Do
you go through all existing objects and add another element
to
or
emptiness is clearly expecting x to be a sequence, *not*
an iterator, and you've violated the contract by passing
it one. This is what you may be running into with the libraries
you mention.
Generally I think it's a bad idea to try to pr
Although I suspect that a string containing "\r\n" is going
to cause more problems for Python applications than this.
E.g. consider what happens when you try to split a string
on newlines.
--
Greg Ewing, Computer Science Dept, +--+
University of
convenient to be able to catch EnvironmentError and
get anything that is caused by circumstances outside the
program's control.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurc
ary between Python
code and .NET code.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand | (I'm not a mo
or codes
might belong to different domains. Although I suppose
you could have another attribute to distinguish them
if necessary.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurc
unds like it has something to do
with the unix environment variables.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand | (I'm
nes, you just have to accept
that you can't also have \r characters meaning something
other than newlines in your files. This is true regardless
of what programming language or I/O model is being used.
--
Greg
___
Python-Dev mailing list
Pyt
ething that ought to be done
automatically by the Python/.NET interfacing machinery,
maybe by having a different type for .NET strings.
--
Greg
___
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
a huge nuisance.
--
Greg
___
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
r of the above models cause the confusion being shown by
> the postings in this thread.
There's no confusion about how newlines are represented
*inside* a Python program. The convention is quite clear -
a newline is "\n" and only "\n"
an that you "don't get
back what you wrote". If you write "\f\n" to a file using
Python and read it back, you get "\f\n". If you write just
"\f", you get back "\f". What the \f *means* is a separate
issue.
--
Greg Ewing, Computer Sc
blem should really be
addressed at the source, which is the Python/.NET boundary.
Anything else would just lead to ambiguity.
So I'm voting -1 on my own proposal here.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury,
ould say IronPython is getting it wrong by using inconsistent
internal representations of line endings.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand | (I'
t need any wrappers. To make
that really true would require IronPython to become
a different language that has a different canonical
representation of newlines.
It's fine with me to keep things as they are.
--
Greg Ewing, Computer Science Dept, +--+
rge
chunks of memory like mark-and-sweep, it happens far less
frequently than would happen if mark-and-sweep were used
for all memory management. Also, the programmer can
minimise the need for it by manually breaking cycles
where they are known to occur.
--
Greg Ewing, Computer Science Dept, +---
Nick Maclaren wrote:
> if Python's own
> interpretation is ambiguous, it is a sure recipe for different
> translators being incompatible,
Python's own interpretation is not ambiguous. The
problem at hand is people wanting to use some random
mixture of Python and .NET conventio
appers, especially cross-platform ones like wxPython.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand | (I'm not a morning person.
and only
mallocs more if that fails.
I think it also counts the number of allocations
made since the last GC and does a GC when it gets
up to some threshold, so that things get cleaned
out periodically and the processing is spread
out somewhat.
--
Greg Ewing, Computer Scie
Adam Olsen wrote:
> This isn't true at all. It's triggered by heuristics based on the
> total number of allocated objects.
Hmmm, all right, it seems I don't know what I'm
talking about. I'll shut up now before I spread
any more misinformation. Sorry.
--
Gr
re is that the GC's lack of knowledge
about how much memory is being used means that you need to care
more than you should have to.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsu
Martin v. Löwis wrote:
> For stack frames,
> such a registration is difficult to make efficient.
Also very error-prone if you happen to miss one. Although
maybe no more error-prone than getting the reference
counting right.
--
Greg
___
Pyth
.o -L/usr/lib -L/usr/local/lib
-L/usr/X11R6/lib -lm -lGLEW -lfreetype -lcal3d -lstdc++ -lode -o
build/lib.darwin-8.4.0-Power_Macintosh-2.3/soya/_soya.so -framework OpenGL
-framework SDL -framework OpenAL
This is on MacOSX 10.4 with Python 2.3.
--
istutils would set it to something appropriate
for the Python being used.
Any suggestions on how I can find out what setting of
MACOSX_DEPLOYMENT_TARGET is being used by distutils, and
how to make it use something different if it's not right?
--
Greg
___
ARGET. I tried setting it
to 10.1, 10.2, 10.3, 10.4 and leaving it unset, and in
all these cases the command works when run directly from
the shell.
So I'm not sure what to try next.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail
but if
it runs gcc directly, it doesn't work.
Anyone have any ideas on how that can happen?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/opt
Oleg Broytmann wrote:
>Do you have a few different copies of gcc installed with setup.py called
> the wrong one and your shell script the right one?
As far as I can tell, it's using my PATH to find gcc,
and that leads to /usr/bin/gcc, which is the same one
my wrapper call
I wrote:
> As far as I can tell, it's using my PATH to find gcc,
> and that leads to /usr/bin/gcc, which is the same one
> my wrapper calls.
To make sure, I installed my wrapper in place of /usr/bin/gcc
and the same behaviour oc
In my experience, the only time recursion is really
called for in Python is when you're operating on
tree-shaped data structures, in which case tail calls
don't really come into it.
When operating on something linear, I find that
a for-loop or list comprehension usually gets the
job
Steve Holden wrote:
> Using a radix notation for literals would, IMHO, be acceptable if you
> can get the idea accepted
This would make decimal (or at least a part of it) a required
part of the Python core rather than an optional module. There
might be some resistance to that.
-
ds more like something written by the GNU folks than
the BSD folks.
--
Greg
___
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
[EMAIL PROTECTED] wrote:
> Does fcntl.flock work over NFS and SMB and on Windows?
I don't think file locking will ever work over NFS, since
it's a stateless protocol by design, and locking would
require maintaining state on the ser
Lauri Alanko wrote:
> In the end, for now, I made protocol 0 textual,
That could be a mistake. I believe there are some objects,
such as array.array, that use a binary format for pickling
even in protocol 0.
--
Greg
___
Python-Dev mailing list
Pyt
if they're buried inside property
descriptors with no other reference to them, it's a lot
harder to get hold of one.
--
Greg
___
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
Guido van Rossum wrote:
> Isn't there? You can just use super() ISTR,
That may work, now that I come to think about it.
However, super() is not a complete solution, because
it doesn't let you choose which inherited method
to call in a multiple inheritance situat
nstance, so that doesn't happen.
--
Greg
___
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
write that as
def attribute.set(self, value):
...
--
Greg
___
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
Raymond Hettinger wrote:
> Let's stick with "propset" which has precedent as an svn action and
> serves as a short, simple mnemonic to the functionality.
But if we're going to have "propset", it raises the question
of w
Phillip J. Eby wrote:
> The lookup sequence should probably be something like:
>
>1. type(ob) is cls
>2. issubclass(type(ob), cls)
But can't issubclass be overridden as well?
--
Greg Ewing, Computer Science Dept, +--+
Univers
st not using them
> in this case)
Fine by me. I've always thought they were of dubious
value in the first place.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zeal
to be able to override it in subclasses, to
me that's an indication that it should be an instance
method.
Also, what happens if you perform such a migration and
then some subclasser later finds that he wants access to
'self'?
I don't see this as a use case
access to
> > 'self'?
>
> Then he overrides it with a normal method.
If that works, I don't see why making the default
method a normal method wouldn't work also.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mai
#x27;s paid off enormously,
as I can produce highly pinpointed error messages for just about
anything at any stage of processing.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubsc
self and discards it, so I still
don't think staticmethod is essential in the absence of
unbound methods.
Not that I would object if it stayed around -- I don't really
mind one way or the other.
--
Greg
___
Python-Dev mailing list
André Malo wrote:
> * Greg Ewing wrote:
>
> > But you could just as well wrap
> > it in a function that takes self and discards it,
>
> I always thought, that this is exactly what staticmethod does.
Not quite -- staticmethod prevents a self from getting
passed in the fi
Steve Holden wrote:
> The namespace should really be called __global__. I doubt this will fly,
> because it's too radical, and unfortunately would undermine the "global"
> keyword
__uberglobal__
--
Greg
___
Python-Dev
Guido van Rossum wrote:
> You can do that but the special entry in globals is still required in
> order to pass it on to all scopes that need it.
Unless you use something other than a plain dict for
module namespaces.
--
Greg
___
Python-Dev m
The next step up from global would be __galactic__.
--
Greg
___
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
Nick Coghlan wrote:
> why not call it __implicit__?
But isn't __explicit__ better than __implicit__? :-)
I tend to agree about __root__, though -- it just
doesn't seem quite right somehow.
--
Greg
___
Python-Dev mailing list
Python-D
Another idea:
__ubiquitous__
--
Greg
___
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
> __the_dictionary_where_all_the_builtins_are_now__
__the_entry_formerly_known_as_builtins__
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mail
, specific module, whereas
__main__ is a pseudo-module which stands in for a different thing
in every Python program. So I'm in favour of keeping an
__xxx__ name for it, to emphasise its magic nature. I'm much
less likely to accidentally stomp on a magic name than a
non-magic one.
--
Greg
__
reasonably expect it to test equal to 0.0. The caveat
only applies to results of a calculation, which may incorporate
roundoff errors.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
Terry Reedy wrote:
> I would prefer plain 'yield' to 'yield break' as a synonym for 'raise
> StopIteration'.
Don't we already have a plain yield these days meaning
something else?
--
Greg
___
Python-De
opIteration. So I see no advantage at all to this
proposal.
--
Greg
___
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
a good reason for having the fd be an
additional mechanism that you can turn on when you want
it, but not the core mechanism for dealing with signals.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-de
s it's solved by 'yield break'
I would put it the other way around -- the problem
that 'yield break' is meant to solve is already solved
by 'return'. So there's no need for change.
--
Greg
___
Python-Dev mailing
s claim?
Even if it doesn't save any power, using CPU unnecessarily
is a bad thing for any application to do on a multitasking
system.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem!
sary.
But there's no excuse for using CPU when the application
truly isn't doing anything other than waiting for
something to happen.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsub
rong, or does it misbehave in
some obscure way?
A test case for this would be to call map() with a
function that tries to suspend itself using this
mechanism. What happens when you try to resume it?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.
By the way, I wouldn't call this a "continuation", as that
word implies a bit more (reusability). It's more like a
coroutine or lightweight thread.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mai
ter the point would give
a result more like floor than trunc.
--
Greg
___
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
prefers using stderr
over stdout for prompting, if using the std files for it at all.
Writing to stdin would be wrong, since it's usually read-only, even
when connected to a terminal.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://ma
the
> utility had insufficient memory in which to operate would not be described.
sounds like an out-of-memory message shouldn't be written to
stderr, which I'm fairly sure is not the case!
--
Greg
___
Python-Dev mailing list
Python-Dev@pyth
Guido van Rossum wrote:
> On Jan 28, 2008 12:35 AM, Greg Ewing <[EMAIL PROTECTED]> wrote:
>>So it appears that the official Unix Way prefers using stderr
>>over stdout for prompting, if using the std files for it at all.
>
> That's a dangerous generalization from
mple is correct, but perhaps somewhat
confusing.
It might help to add a note to the effect that this
example is meant to illustrate that the descriptor doesn't
have to exactly match the C description, as long as it
describes the same memory layout.
--
Greg
_
he
indices when dealing with Fortran if need be.
You would have to do that anyway when accessing the array
from C, so it's probably better to have the description
always match the C ordering.
(Makes things a bit harder for those people writing their
Python ex
Christian Heimes wrote:
> By the way objects are always aligned at 8 byte address boundaries. A 12
> or 4 bytes object occupies 16 bytes.
Maybe pymalloc should be enhanced so it can cope with
certain odd-sized objects, such as 12 bytes?
--
Eric Smith wrote:
> Are you saying I should call _PyType_Lookup first?
No, I think he's saying that you don't need to call
_PyType_Lookup at all, because anything that it could
find will also be found by PyObject_GetAttr.
So just call PyObject_GetAttr and it should Just W
uld be better.
--
Greg
___
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
e. If a caller needs
a pointer to an object, shouldn't it be holding a
counted reference to it?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
s
having to say "%x".format(_) or some such all the time to
see the results in hex.
An alternative might be to have some variable that can be
set to control the format of numbers printed by the interactive
shell.
--
Greg
___
Python-Dev ma
27;t bother providing a __dict__,
since one doesn't normally need to add arbitrary
attributes to them, and the overhead would be almost
completely wasted.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/lis
aberration that
was necessary in Python 2 because there wasn't much
alternative.
--
Greg
___
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
Christian Heimes wrote:
> The latest alphas of Python 2.6 and 3.0 are build with VS 2088.
Wow, that must be a very, very pre-alpha release...
Or has someone at Redmond stolen Guido's time machine?
--
Greg Ewing, Computer
ltins.
Maybe the solution is to rename the Library Reference
to the Class and Module Reference or something like
that.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand
o compile extensions
against *that* library instead. If it were compiled with
gcc but using one of the Microsoft libraries, the same
situation would exist as before.
The entire mess is all Microsoft's fault for not picking
one version of libc and sticking to it.
--
Greg Ewi
Mike Meyer wrote:
> Trying to install it from the repository is a PITA, because
> it uses both the easyinstall and Pyrex
It shouldn't depend on Pyrex as long as it's distributed
with the generated C files. If it's not, that's an
oversight on the part of the distributor.
Adam Olsen wrote:
> The term "Displays" is pretty obscure as well,
Hmmm, I'd call them "constructor expressions" or some such.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/lis
e to BNF would be syntax diagrams. They're
just as formal, and can be a lot easier to read.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/opti
ant on tools that appear and disappear at
the whim of Microsoft. Their "free" compilers only
last until the next version, then they become
unavailable. So it can still be a problem finding
exactly the right version to match your Python
installation, if you missed the window of opp
xtension using
one stdio library and the base interpreter another?
> Maybe it's possible (and not too late) for
> Python to somehow embrace such mechanism?
There would have to be an awful lot of stubs to cover
the whole Python/C API... but maybe that
re some general expectations one
should be able to have of any implementation, e.g. that
accessing a list item is roughly O(1), and not O(n) as
it would be if they were implemented as linked lists.
Dict access should probably be documented as no worse
than O(log n) to allow for tree implementat
a dict that you've
just deleted a lot of things from is to insert something, then
delete it again, and then copy. :-)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http:
is small doesn't
necessarily mean the algorithm is efficient.
> For a theoretically-reasonable definition of "small",
> prepending is O(1):
Big O-notation is all about the limit when
things get big. So it doesn't make sense to talk
about "O() when something is small&quo
27;s much more common to iterate directly over a
sequence of things you want to operate on.
This is even more true now that we have enumerate(). So
this proposal is addressing a fairly small set of use
cases.
--
Greg
___
Python-Dev mailing list
Py
sts as
linked lists would make many people unhappy, as their
algorithms suddenly went from O(n**m) to O(n**(m+1))
without anyone telling them.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubs
get at things quickly.
--
Greg
___
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
ask based on
experience is good design practice.
--
Greg
___
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
I'm trying to send a proxy form, but all my mail to
[EMAIL PROTECTED] or [EMAIL PROTECTED] is getting bounced.
Is there another address I can send it to that goes
through a different mail server?
--
Greg
___
Python-Dev mailing list
Pytho
If we have a hierarchy of classes, and we use
__getstate__/__setstate__, the wrong version
of __setstate__ gets called.
Possibly, this is a documentation problem, but here goes:
Take two classes, A and B, where B is the child of A.
Construct a B. Pickle it. Unpickle it, and you find
that the
r" idea.
If the integers were used to directly index an
array instead of being used as dict keys, it
might make a difference. The cost would be that
every namespace would need to be as big as
the number of names in existence, with most
of them being extrem
at I'd be happy to discuss.
--
Greg
___
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
s, and the existing machinery would take it from
there.
--
Greg
___
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
r(), so
making print alone do this probably wouldn't be very
useful.
--
Greg
___
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
e willing and/or able
to track down and install dependencies along with an
app.
--
Greg
___
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
y
so special, or should bytes be acceptable in any context
requiring a string, with an implicit encoding of ascii?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mai
ncoded characters.
But an equally plausible interpretation might be
that it's some binary representation of a number.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubsc
I thought Decimal was going to be replaced by a C
implementation soon anyway. If so, is it worth going
to much trouble over this?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
Nick Coghlan wrote:
> Greg Ewing wrote:
>
>> I thought Decimal was going to be replaced by a C
>> implementation soon anyway.
>
> I believe that was found to be more trouble than it was worth.
That's very disappointing. Was there any discussion of
the problems tha
1501 - 1600 of 2499 matches
Mail list logo