ke a byte
array containing ascii chars look like a string?
Then cases like this could be handled without having
to copy the data.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscri
t
through very well when the Python version was designed.
The question now is whether to fix the API design, or
leave it to become entrenched and lose all hope of
ever having a fully C-coded implementation.
--
Greg
___
Python-Dev mailing list
Python-Dev@p
Georg Brandl wrote:
> As Nick said, a drop-in replacement in C isn't feasible
Yes, but that appears to be so only because of some
unfortunate features of the Python version's API.
Seems to me it would be better to undergo a little
pain now and get a well-designed C-friendly A
x27;t be an object with a mapping
interface for this, that stores them internally as a
bit field or whatever is convenient for the C code.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
U
with eggs the other day -- it
seems that tracebacks referring to egg-resident files contain the
pathname of some temporary directory that existed when the egg
was being packaged, rather than the one it actually exists in
at run time.
--
Greg
___
Pyt
install to install it. If I'd known that setuptools
would make intrusive changes to the behaviour of my
system, I would never have touched it.
Is there a way of *un*installing setuptools? I'd like to
put my Python back the way it used to be.
--
Greg
_
. The actual path
is known when the module is loaded, so it should just be a matter
of storing it somewhere appropriate.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
"File could not be
read/written/whatever because..." kind of message. Having
EOFError get missed by that would be a nuisance.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
ch like
a list. I think that would make things more confusing
for a newcomer rather than less.
The way they are, at least it's obvious that they're
something special.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pyt
nt.
However, thinking about it a bit more, anything that
calls something that can raise EOFError should be
catching it anyway, so an escaped EOFError represents
a program bug. So it's probably okay.
--
Greg
___
Python-Dev mailing list
Python-Dev
Guido van Rossum wrote:
> That's why I proposed <0, 1, ..., 9> for repr(range(10)).
My worry is that this will lead a newcomer into thinking
this is some kind of valid expression syntax.
--
Greg
___
Python-Dev mailing list
Python-Dev@p
ndard exception
type if one existed at the right point in the hierarchy
to catch what I want to catch, but there isn't one.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
ht
Guido van Rossum wrote:
> You are unique in demanding this.
Really? Nobody else wants a convenient way to
distinguish program bugs from exceptions caused
by external factors?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
h
Guido van Rossum wrote:
> You are unique in demanding this.
I'm not asking for anything to be changed (I've
already agreed that EOFError can stay the way it
is), just pointing out what I think is a legitimate
use for custom EnvironmentError subclass
Brad Miller wrote:
>
I wouldn't include the word "object" in any of these.
Everything in Python is an object, so it's just
space-wasting noise.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/
s designed for, and I'm perplexed to be told that
it's not.
--
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
Michael Foord wrote:
> It seems to be more common in the 'Python world' to refer to indexing
> than subscription
Especially since the subscript isn't actually written
as a subscript, unless you have a particulary fancy
cod
ndex", on the other hand, directly suggests the
idea of looking something up, without relying on
indirection through typography and mathematical convention.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/list
program's control, but which aren't detected and reported
by any of the built-in IOError or OSError exceptions.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mai
Steven Bethard wrote:
I'm not a big fan of the sequence-or-callable argument. Why not just
make it a callable argument, and supply a utility function
Or have two different keyword arguments, one for a sequence
and one for a callable.
--
Martin v. Löwis wrote:
Ok. Jesus, can you please send me your SSH key?
Nice to see that Heaven is security conscious and
accepting encrypted prayer nowadays. :-)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org
e object instead of a file descriptor, since that's
what you really want most of the time. At least I always
end up calling fdopen on it.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsub
s the
named-ness of it rather useless, as far as I can see.
If you don't want that to happen, you have to use
mkstemp.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscr
Certainly there's no way to tell whether you want it
treated as binary, so at least that much of the mode
needs to be specified.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
give you a file that *doesn't*
go away when you close it, and has a name so you can
go on to do other things with it.
So I plead ignorance due to misleading documentation.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.
I ended up finding better solutions.
So if it were up to me, I wouldn't be putting any effort
into making it easier to use.
I'm actually worried that making it too easy to use
could lead people into using it when it's not appropriate.
--
Greg
_
yword.
Conversely, I would say that if it doesn't deserve a
keyword, it also doesn't deserve that much magic.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/
be
for, but I can't see it working properly except under very
special circumstances -- so special that they have never
turned up in any code I've written so far.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.o
matters by
delegating to one or another of the inherited classes
(using explicit inherited method calls, not super!).
If it's not feasible to do that for some reason, then
you're better off forgetting about multiple inheritance
and finding some other solution to the problem
ys as well, so I've come to regard multiple
inheritance issues as a code smell suggesting that
I need to rethink something.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
Maybe "def is an executable statement" is another thing
people have a blind spot about?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/opt
Armin Rigo wrote:
More precisely, the sprint will be in the crashed c-base space station,
Berlin, Germany, Earth, Solar System.
You have a crashed space station in Berlin? Wow! I hope
it didn't come down on anything important...
--
Greg
___
P
like.
One small problem is that there would be no sensible
name to give the function object, but that's no
worse than what you get when using a lambda.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/
Terry Reedy wrote:
In any case, American programmers are not 'average' Americans ;-).
So I say use it!
Plus, think of all the millions of people who will have
their lives enriched by learning to spell 'Rietveld'
properly!
--
Greg
__
into his
designs.
--
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
Tristan Seligmann wrote:
The correct way to do this is to create a temporary directory, and then
generate a filename underneath that directory to use.
Yes, otherwise you can get bitten by the race condition
that's the reason for mktemp being deprecated.
--
tically
without being told about it.
--
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
Steve Holden wrote:
If you want it visible, make a visible symbolic link!
I have to know it's there first. The idea of an installer
deliberately hiding stuff from me in a very unconventional
and non-obvious way makes me uncomfortable.
--
Guido van Rossum wrote:
The location will be somewhere under ~/.local
for Unix/Linux/OS X,
Can I just put in a plea for this to be somewhere
under ~/Library on OSX, and not hidden?
MacOSX already has clear conventions for this sort
of thing -- there's no need to use a dot-name there.
--
Antoine Pitrou wrote:
When you write a processing
script for internal use there's no reason to worry about security issues like
that
Even without security issues, there's still the potential
for two processes creating temp files at the same time to
trip over each other
ng on
whether you're expecting to get a copy of the
file descriptor or not.
--
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:
Can you come up with a path that fits the purpose of a base directory?
"~/Library/Application Support/Python" would seem to be
appropriate.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.
s it's for installing 3rd party packages.
So the obvious user-level analogy would be
"~/Library/Python/x.y".
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http:
and seen by the user,
and 'xxx' is for things that are only used internally,
e.g. enumerated type values and attribute names for use
by getattr().
I wouldn't like to see any guideline that said you
should only use double quotes or something like that.
--
Greg
_
tains facilities for
indicating the encoding and other things as well.
Yup, but DrProject (the target application) also serves as a relay and
archive for email. We have no control over the agent used for
composition, and AFAIK there's no standard way to include encoding
in
Steven D'Aprano wrote:
The only thing I can think of is printing lines with line numbers
Parsing a file and wanting to be able to print
error messages with line numbers would seem to
be a fairly likely use.
--
Greg
___
Python-Dev mailing list
P
benefit from having
access to implementation details of the string.
--
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
be meaningless.
--
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:
Talin wrote:
multiprocessing
multiprocessing would work for me
Me, too.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
le cores, and a fancier one (maybe based
on MPI) for people who want grid-computing style
distribution with error handling, fault tolerance,
etc.
(I didn't set out to justify that paragraph,
btw -- it just happened!)
--
Greg
___
Python-Dev mai
give the right impression?
(Still allows for networking -- nobody says all the cores
have to be on the same machine.:-)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://
at all can be, and is, referred to as
"processing". So the intended meaning fails to come across.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.
asn't, two threads would still only use one core's worth.
Also, if you have only two cores, using more than two
threads isn't going to gain you anything whatever happens.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mai
ng one situation here where it *is* a problem.
--
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:
So what do people think of including a ProxyBase implementation in 2.6
and 3.0 that explicitly delegates all of the C-level slots to a
designated target instance?
Sounds good to me.
--
Greg
___
Python-Dev mailing list
Python-Dev
Christian Heimes wrote:
I assume recvfd and sendfd
aren't syscalls but the proposed names for the functions.
Yes, the functionality in question is accessed through
the sendmsg() and recvmsg() system calls.
--
Greg
___
Python-Dev mailing list
P
Exception" recommendation
(although that might still be an improvement over the
status quo).
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/opt
I wrote:
Shouldn't it only be catching AttributeError, though?
Forget that, I forgot that PyObject_HasAttr can't
signal an exception.
The Py3 C API should be designed to fix this, I think.
--
Greg
___
Python-Dev mailing list
Python-Dev@
Martin v. Löwis wrote:
IIRC, it chokes on the attempt to compile assembler code that
has C preprocessor macros in it (can't test it right now).
Could the build process be modified to run the C preprocessor
over the assembly language first?
--
of it.
Some way of explicitly requesting a view into another
string might be desirable, but it shouldn't be the
default behaviour for string slicing.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/lis
her method.
--
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:
else:
# Returned a different object, make a new proxy
result = type(self)(result)
You might want to check that the result has the
same type as the proxied object before doing that.
--
Greg
___
Python-Dev
ed to me
that this is something you can do with an OO system
that you can't do so easily with a generic function
system. If the operations being proxied were generic
functions rather than methods, you'd have to override
them all individually instead of having a central point
to catch the
) already cover that?
--
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
owing __iter__ would just seem perverse.
A case could be made for strings being sliceable but
neither indexable nor iterable, but it's probably too late
to make such a radical change now.
--
Greg
___
Python-Dev mailing list
Python-Dev@pytho
Mike Klaas wrote:
I agree that it would be perverse to disallowing iterating over a
string.
Just to be clear, I'm saying that it would be perverse
to disallow iterating *but* to allow indexing of
individual characters. Either you should have both or you
should have neither.
--
Georg Brandl wrote:
Greg Ewing schrieb:
>
Doesn't isinstance(x, basestring) already cover that?
That doesn't cover UserString, for example.
A better solution to that might be to have UserString
inherit from basestring.
--
Greg
_
to solving
Yes, I agree with that. It was just something I thought
of that shows that generic functions and OO are not
quite equivalent in general.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/pyth
__getattr__ you know what you're doing can
*only* affect the proxy object and nothing else.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/opt
Georg Brandl wrote:
Greg Ewing schrieb:
A better solution to that might be to have UserString
inherit from basestring.
But with that argument you could throw out the whole ABC machinery,
just let all lists inherit from list, all dicts from dict, etc.
Well, I'm skeptical about the whol
think that the ABC idea in general suffers from
that problem, to one degree or another depending on
the class involved. Strings are just an extreme case.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/
be
a lost cause, since it will never be acceptable in
those places, whatever is done with ABCs.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/op
Benjamin Peterson wrote:
I agree that the threading the the pyprocessing APIs should be PEP 8
compliant, but I think 2 APIs is almost worse than one wrong one.
So change them both to be PEP 8 compliant, and leave
aliases in both for existing code to use.
--
Greg
Nick Coghlan wrote:
- remove support for passing a single value to a format string without
wrapping it in an iterable first
But won't that clobber a large number of the simple
use cases that you want to keep %-formatting for?
--
Greg
___
Pytho
eem like a good
idea to me.
--
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
re all
realised at once. The cost-benefit analysis needs to
take the entropy into account somehow.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/opt
e able to write that as
"...{num}...".format(num = 2)
--
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
Maciej Fijalkowski wrote:
What do you think about this code:
class A:
locals()[42] = 98
Seems people rely on it working. Do we consider it part of python
language?
Modifying the dict returned by locals() is documented
as NOT being guaranteed to work, isn't it?
--
x27;s any substantial need for it. I don't believe
there is in Python, because you can always put a reference
to the target object into a succinctly-named local and access
it through that.
You can't always do that in Pascal, because it provides no
way of obtaining a pointer a record that
essionable
minds of new programmers, IMO.
--
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
; or maybe "keyed list" would be
a better term for the first variety.
And "sorted dict" seems like a good enough term for
the other one.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo
use it in tutorials,
where it's the first thing the newcomer will see, and
get the impression that it's the normal thing to do.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubs
ts in existence,
increase the threshold for performing GC by some
factor.
You would also want to do the opposite, so that a
GC pass which reclaims a large proportion of objects
would reduce the threshold back down again.
--
Greg
___
Python-Dev mailing list
P
er of objects on the heap grows
Wouldn't it be simpler just to base the collection frequency
directly on the total number of objects in the heap?
From what another poster said, this seems to be what
emacs does.
--
Greg
___
Python-Dev mailing list
Martin v. Löwis wrote:
Wouldn't it be simpler just to base the collection frequency
directly on the total number of objects in the heap?
Using what precise formula?
The simplest thing to try would be
middle_collections >= num_objects_in_heap * some_constant
might be when matching against
a huge string.
The behaviour you observed might have been due to the
nature of the re being matched -- some res can have
quadratic or exponential behaviour all by themselves.
--
Greg
___
Python-Dev mailing list
Python-Dev@
Raymond Hettinger wrote:
To me, the one obvious way to convert a number to a
eval-able string in a different base is to use bin(), oct(), or hex().
What use cases are there for an eval-able representation
of a float in those bases, as opposed to a human-readable
one?
--
Greg
tomer filiba wrote:
>>> def f(**kwargs):
... print kwargs
...
>>> f(a=5,b=7,a=8)
{'a': 8, 'b': 7}
>>>
I can't think of any reason why one would need to be
able to write such code, or even want to.
--
Greg
__
s not supported.
--
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
just
relying on cyclic GC?
--
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
en classes,
functions and the module dict, are unlikely to contain
objects with ___del__ methods, so there wouldn't be
much of a problem in practice.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-
Ben Finney wrote:
That's another reason to avoid "assert" in the name: these methods
*don't* necessarily use the 'assert' statement. Avoiding the
implication that they do use that is a good thing.
Perhaps some positive alternative such as "veri
ntion is chosen, there will be situations in
which you want to mentally negate it. If you start with a
positive, the mental negation produces a single negative.
If you start with a negative, the mental negation produces
a double negative. Therefore it is less confusing overall
to start with as few n
on names, they could be read either way, so
it comes down to readability. To my eyes there is no
loss of readability when omitting the underscores,
so simplicity argues for leaving them out.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://ma
that it's a test framework, would
a programmer really find it hard to guess what these
mean?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/m
owever, that meaning doesn't quite seem to fit here, as
we don't just want to claim that the condition is false,
but *ensure* that it's false. I can't think of a single
word offhand that means that.
--
Greg
___
Python-Dev m
databases, but what about people with
existing bsddb files that they need 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/options/python-d
r, invent a new type that behaves the way
you want.
--
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
ng that can be treated as
a 2D sequence.
Why matrix multiplication in particular? Because it's the one
thing that you do all the time with matrices for which there
isn't an available operator. I think this one addition could
be justified on the grounds of very wide usage.
--
Greg
___
ication in both Python
and numpy?
--
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
1601 - 1700 of 2499 matches
Mail list logo