for the third option. Isn't that the
sort of thing the fancy new ast system is designed for?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/o
on
A writes PyObject_Alloc(some_chars), Person B
writing the code to free it thinks "What???
That can't be right!" and uses PyMem_Free.)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-
umption that you're going to see the module name
as well.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiam! |
Christchurch, New Zealand | (I'm not a morning person.
Steven Bethard wrote:
>make :
>
I don't like the position of the name being defined.
It should be straight after the opening keyword, as
with 'def' and 'class'. This makes it much easier
to search for definitions of things, both by eyeball
and editor
e's no problem in giving an operator
different unary and binary meanings; '-' already does
that.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.pytho
and now
Construct).
--
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
ith a new package and a new name, then
there wouldn't be any backwards-compatibility issues to
hold it back.
I'd like to see a different approach taken to the design
altogether, something more along the lines of Scons.
Maybe it could even be an extension
t breaking something
that someone relied on. It's hard to fix something
if you can't change it at all.
I'd be happy to discuss ways of evolving distutils
into something better, but first we have to decide
that it is actually permissible to change it and
possibly break stuff t
Terry Reedy wrote:
> I took a look. The only thing that puzzles me is 'warp factor', which
> appears exactly once.
It's been put there via time machine in connection
with the dilithium crystal support in that will be
added in Python 7.0. You don't need to wo
Fredrik Lundh wrote:
> (distutils and setuptools are over 15000 lines of code, according to sloc-
> count.
Ye cats! That's a *seriously* big ball of mud. I just checked,
and the whole of Pyrex is only 17000 lines.
--
Greg
___
Python-Dev m
l cases. He
might be installing a package distributed by someone with a
different version of Pyrex that wasn't quite compatible. If
he's not modifying the .pyx files, it would be safer to just
use the provided .c files.
--
Greg
___
Python-Dev ma
g better is
available.
--
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
t this necessarily has to be
done with distutils, but if it did need to be done,
I think it could be done, with sufficient effort.
I do think that the fact nobody but the now-absent
author seems to understand the internals of distutils
is a very serious problem, and something needs to be
data called "resources".
Then Microsoft stole the name, and before you knew,
everyone was using it. It's all been downhill from
there. :-)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/
he existing components for dealing
with .c files, and do it in an obvious and straight-
forward way (and hopefully without having to be
excessively Dutch in order to see the obviousness
of it:-).
--
Greg
___
Python-Dev mailing list
Python-D
nly work on string
literals. But then you can't use an i18n package to
rewrite the string at run time. And trying to i18n
the component parts of the string doesn't work
because of grammatical differences between languages.
--
Greg
___
Python-Dev ma
the way it does now as long as it used the
special open().
--
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
esources
used internally by the application. They don't *need*
to be accessible outside the application. So I don't
think the KDE argument applies here.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/l
Martin v. Löwis wrote:
> Greg Ewing wrote:
>
>>>The "resources" name is actually quite a common meme;
>>
>>I believe it goes back to the original Macintosh,
>
> I can believe that history. Still, I thought a resource
> is something you can exhaust;
corporated
into the cheeseshop? So you could ask e.g. for your
favourite package in .rpm format, and if it only knew
how to get it in .egg format it would feed it to a
handy bdist-bot for conversion.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
htt
rk in resources of type
"CODE". The data fork of an application was usually
empty.
--
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 trying hard to improve the "just
doesn't work" case. To do that, we need *LESS* magic,
not more. We need to do things in as straightforward,
obvious and transparent a way as possible -- so that
when it goes wrong, you can see why it is going wrong
and how to make it go righ
obody can tell what's an implementation
detail and what isn't.
--
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
ython setup.py build --compiler=mingw32
python setup.py bdist_wininst
? If so, that's rather unintuitive and could do
with documenting more clearly.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/pyth
appointing. I *liked* the way that
decimal.Context was a context. Was there a conscious
choice to swap the terms, or did it happen by accident?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Un
equires 2.1 or later
of Z, and you want to use C which requires both A and B...
--
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/
Thomas Heller wrote:
> The best solution is to configure the mingw32 compiler in the distutils
> configuration file.
That's the same conclusion I came to. But it's
unintuitive that you can't also do the same
thing using command line options, or if you
can, it's not obvi
the explicit relative import mechanism.
I don't see that this has anything to do with relative imports.
It's just the usual kind of problem you get with 'from ... import ...'
and mutual imports.
Does
import .foo
work?
--
Greg
Alex Martelli wrote:
> GMP is covered by LGPL, so must any such derivative work
But the wrapper is just using GMP as a library, so
it shouldn't be infected with LGPLness, should it?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.
nd quite straightforward
to explain and understand. Somewhere along the way
it seems to have mutated into a monster that I can't
keep in my brain any more. This can't be a good
thing.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.or
s a library will be including gmp.h. So
that in itself doesn't imply that you're doing more
than using it as a library.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
h
for x in otherstuff:
dosomethingelse(x)
would be a SyntaxError because the inner loop
is trying to use x while it's still in use by the
outer loop.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/list
ny more
terms. But if another term is needed for an object with a
__context__ method or equivalent, I rather liked Nick's
"context specifier".
--
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
It's not
as if people are going to be implementing context
managers/guards every day.
--
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
Delaney, Timothy (Tim) wrote:
> So would this also be a SyntaxError?
>
> for x in stuff:
> x = somethingelse
That would be something to be debated. I don't
really mind much one way or the other.
--
Greg
___
Python-Dev ma
ly difficult for an IDE to do without
static type information.
--
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
like
that recently, but I can't remember the
details.
> and am +0 on the double use below:
>
> for x in y:
> for x in z:
Can anyone think of a plausible use case for that?
--
Greg
___
Python-Dev mailing list
Python-Dev@pyth
Guido van Rossum wrote:
> On 5/2/06, Greg Ewing <[EMAIL PROTECTED]> wrote:
> >make_person(=name, =age, =phone, =location)
>
> And even with Terry's use case quoted I can't make out what you meant
> that to do.
I meant it to do the same thing as
mak
ere there
are literally dozens of potential arguments to many
of the constructors. The only sane way to deal with
that is for them to be keyword-only, at least
conceptually if not in actual implementation.
--
Greg Ewing, Computer Science Dept, +--+
U
tadata there is about a file on a platform.
And having .isdir etc. attributes on the stat() result
abstracts whether they're obtained from the permission bits
or not.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mai
ot; is not well-defined in
all cases. What about filenames with multiple suffixes,
such as "spam.tar.gz"? What part of that would you put in
the extension attribute?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pytho
s them to be passed by keyword.
--
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
Tim Peters wrote:
> Instead it would make best sense for each
> sprint project to work in its own branch, something SVN makes very
> easy, but only for those who _can_ commit.
There's no way of restricting commit privileges to
a particular br
(This is not hypothetical -- it's a common convention
in some unix systems to use names like "spam.d" for
directories of configuration files.)
--
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
all of its own.
That seems like the best idea, because it gives the
most flexibility for dealing with the quirks of
different systems' pathname semantics.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/
no point in being
able to name 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
number of potential keywords that you could use.
--
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
of a string containing a backslash,
you will see two backslashes, but they're only in the repr(),
*not* in the string itself.
Some things to ponder:
>>> "\{" == r"\{"
True
>>> len("\{")
2
>>> len(r"\{")
2
--
Greg
_
_Clear take notice of that flag.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand | (I'm not a morning person.)
Heiko Wundram wrote:
> for node in tree:
> if not node.haschildren():
> continue
>
Er, you do realise that can be written more straightforwardly as
for node in tree:
if node.haschildren():
g.
l = [foo(x)
for x in stuff
if something_about(x)]
for the very reason that it makes them easier to read.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http:/
rder to follow than ones without -- exactly the
opposite of what you seem to prefer.
Also, I don't find an extra indendation level to be
a problem at all, unless the code under it is more
than a screen long -- in which case you've got big
readabili
at it so that it's no longer in-line?
The point of doing that eludes 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
es readability for no
corresponding benefit.
--
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 screen, which it should.
--
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
t;correct" in this case,
i.e. the result of replacing an empty string should be
undefined (because any string contains infinitely many
empty substrings).
+0 on raising an exception if you try.
--
Greg
___
Python-Dev mailing list
Python-Dev@python
omething that takes an address and a size. (Is
there a PyLong_FromStringAndSize()? If not, there
should be.)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.
rom
a Windows and a VMS port of the effbot that got
mixed together somehow...
--
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
ode that needs select-like functionality very awkward.
Rather than adding yet another platform-dependent module,
I'd like to see a unified Python interface in the stdlib
that uses whichever is the best one available.
--
Greg
___
Python-Dev mailing lis
t; thereof), otherwise epoll where available and nonbuggy, otherwise
> poll ditto, otherwise select
It would be an improvement if it would just pick *some*
implementation that worked, even if it weren't strictly
the best.
--
Greg
___
Python-D
Or "Just two cents' worth of end-user experience here",
which is almost as concise as the original and much
easier to parse.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscr
Neal Norwitz wrote:
> Should the following values be ints (limited to 2G)?
>
> * line #s and column #s
Anyone with a source file more than 2G lines long
or 2G chars wide deserves whatever they get. :-)
Not-investing-in-a-1.3e10-pixel-wide-screen-any-time-soon
), "count", etc.
Although Tim pointed out that replace() only regards
n+1 empty strings as existing in a string of lenth
n. So for consistency, find() should only find them
in those places, too.
--
Greg
___
Python-Dev mailing list
Python-De
ime with a high-resolution timer :-)
Obviously what we need here is a stand-alone Python interpreter
that runs on the bare machine, so there's no pesky operating
system around to mess up our times.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
ht
Macs the other day, and I wondered
whether it would be possible to configure it so that one
core was running MacOSX and the other was running Windows
at the same time.
It would give the term "dual booting" a whole new
meaning...
--
Greg
___
tralised
way of redirecting stdout and/or stderr through the logging
module. That would fix the problem for all modules, even
if they know nothing about logging.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/lis
ations".
So why the heck is hexlify looking for charbuffers and not
byte buffers in the first place?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/m
articularly unconvinced by the spreadsheet argument.
In that context, I'd say that everything is a 2-D array,
and a single cell is a 1x1 2-D array, not a 0-D array.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org
you index it, e.g.
A2 = [[1, 2], [3, 4]] # a 2D array
A1 = A2[1] # a 1D array
A0 = A1[1] # a 0D array???
print A0
What do you think this will print?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/ma
Bingo - write access to outer scopes!
Okay, I'm +0 on this now. But for that use, we'd need
a more convenient way of creating one than importing
NumPy and using array().
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.py
hing does a[] yield? Do we finally,
at last, get an actual scalar, or do we get a -1 dimensional
array? :-)
I'm having trouble seeing a real use for a 0D array as
something distinct from a scalar, as opposed to them
just being an oddity that happens to arise as a side
effect of the way Numeric/
a
syntax that was motivated by a perceived need
for dealing with 0D arrays. So it seems relevant
to ask whether 0D arrays are really needed or not.
Does anyone have any other use case for this
syntax?
--
Greg
___
Python-Dev mailing list
Python-De
bout it, such as the period) is vital.
PRNGs are not like sorting algorithms, where different
ones all give the same result in the end. Different PRNGs
have *wildly* different characteristics.
--
Greg
___
Python-Dev mailing list
Python-Dev@py
m?
Or is the probability of getting such an initial state
too small to worry about?
--
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
1 times.
It's not a matter of how many times it's called, but
of how much internal state it has.
A generator with only N possible internal states can't
possibly result in more than N different outcomes from
any algorithm that uses its results.
--
Greg
___
rint 'yay! a c!'
> else:
> print 'hey dummy! I said a, b or c!'
Before accepting this, we could do with some debate about the
syntax. It's not a priori clear that C-style switch/case is
the best thing to adopt.
--
Greg
exhibit _much_ more random behavior
Then you haven't got a deterministic algorithm.
--
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
solve.
(Essentially it would require returning some object
that raised an exception when anything at all was
done to it, but such an object would cause debuggers
and other introspective code to choke.)
--
Greg
___
Python-Dev mailing list
Python-Dev@pyth
hat follows the switch statement is not a normal suite, but a
> restricted one,
I don't see that as a problem. And all the proposed syntaxes
I've ever seen for putting the cases at the same level as
the switch look ugly to me.
--
Greg
___
der of evaluation and testing is undefined. So the first
time through, the values could all be put in a dict, to
be looked up thereafter.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
it produces, not each individual
number. And if the rng state is the only initial
condition that can vary, it can't produce more than
5 distinct sequences.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listi
[EMAIL PROTECTED] wrote:
> Greg> Multiple values could be written
>
> Greg>case 'a':
> Greg>case 'b':
> Greg>case 'c':
> Greg> ...
>
> That would be an exception to the rule that a line en
[EMAIL PROTECTED] wrote:
> Greg> A way out of this would be to define the semantics so that the
> Greg> expression values are allowed to be cached, and the order of
> Greg> evaluation and testing is undefined. So the first time through,
> Greg> the values co
oduce every
> possible ordering,
But how do you decide how many times to shuffle before
dealing the cards? If you pull that number out of your
RNG, then you're back in the same boat. If you get it
from somewhere else, the RNG is no longer the only
thing de
e each time, it can't
increase the number of possible results.
While you probably understood this, it's worth
pointing out explicitly, because some people don't,
or neglect to consider it when thinking about this
sort of situation.
--
Greg
_
of symbolic names,
values precomputed a run time, etc.
A new statement would allow us to simply document
that the case values are *assumed* constant, and
then the implementation could cache them in a dict
or whatever.
--
Greg
___
Python-Dev mailing lis
inking about all these years, in which
case there will only be optparse. Unlikely.)
Greg
--
Greg Ward <[EMAIL PROTECTED]> http://www.gerg.ca/
Reality is for people who can't handle science fiction.
___
Python-Dev mai
tter of
providing a construct that expresses the high-level
intent of the code more clearly than an if-else
chain. I think both of these are equally important.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/
;s also a lot clearer how it interacts with closures,
which is another good point.
I recommend adding this option to the relevant PEP
(whichever it is).
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/pyt
Phillip J. Eby wrote:
> Sadly, it's not *quite* that simple, due to the fact that co_lnotab must be
> increase in line numbers as bytecode offsets increase.
I think it's high time all the cleverness was ripped out
of the lnotab and it just became a plain array of independent
e
Raymond Hettinger wrote:
> switch x:
> case 1: one()
> case 2: two()
> case 3: three()
> default: too_many()
>
> Do we require that x be hashable so that the compiler can use a lookup
> table?
That sou
can always put your own test for hashability
around it if 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
ses might be sufficient,
> essentially making what follows a case *always* take on sequence
> syntax.
Sounds good to me.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
Fredrik Lundh wrote:
> Q: If a program calls the 'func' function below as 'func()'
> and ONE and TWO are both integer objects, what does 'func'
^^
Nothing at all,
Phillip J. Eby wrote:
> switch x:
> case == 1: foo(x)
Aesthetically, I don't like that.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail
= 3
...
switch f:
case Foods.Spam:
...
case Foods.Eggs:
...
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/
ues of a top-level case. It's undefined
behaviour anyway.
--
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
ven a .py suffix as an
alternative way to mark it as a package?
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand | (I'm not a morning person.) |
[E
he case expression
being evaulated for every call to the function. A
case at the module level would just be an instance
of that.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christ
current behaviour,
it looks like __class__ and __bases__ will be bypassed
by isinstance() (unless Guido decides to change that).
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch,
2201 - 2300 of 2499 matches
Mail list logo