Re: [Python-Dev] elementtree in stdlib

2006-04-08 Thread Greg Ewing
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

Re: [Python-Dev] pdb segfaults in 2.5 trunk?

2006-04-10 Thread Greg Ewing
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-

Re: [Python-Dev] [Python-checkins] r45321 - in python/trunk: Lib/test/test_traceback.py Lib/traceback.py Misc/NEWS

2006-04-12 Thread Greg Ewing
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.

Re: [Python-Dev] PEP 359: The "make" Statement

2006-04-15 Thread Greg Ewing
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

Re: [Python-Dev] a flattening operator?

2006-04-18 Thread Greg Ewing
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

Re: [Python-Dev] adding Construct to the standard library?

2006-04-18 Thread Greg Ewing
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

Re: [Python-Dev] Raising objections (was: setuptools in the stdlib)

2006-04-18 Thread Greg Ewing
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

Re: [Python-Dev] Raising objections

2006-04-19 Thread Greg Ewing
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

Re: [Python-Dev] 2.5a1 Performance

2006-04-20 Thread Greg Ewing
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

Re: [Python-Dev] Raising objections

2006-04-20 Thread Greg Ewing
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

Re: [Python-Dev] Raising objections

2006-04-20 Thread Greg Ewing
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

Re: [Python-Dev] Raising objections

2006-04-20 Thread Greg Ewing
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

Re: [Python-Dev] Raising objections

2006-04-20 Thread Greg Ewing
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

Re: [Python-Dev] magic in setuptools (Was: setuptools in the stdlib)

2006-04-20 Thread Greg Ewing
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/

Re: [Python-Dev] Distutils thoughts

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] proposal: evaluated string

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] magic in setuptools (Was: setuptools in the stdlib)

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] magic in setuptools (Was: setuptools in the stdlib)

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] magic in setuptools (Was: setuptools in the stdlib)

2006-04-21 Thread Greg Ewing
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;

Re: [Python-Dev] magic in setuptools (Was: setuptools in the stdlib)

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] magic in setuptools (Was: setuptools in the stdlib)

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] setuptools in 2.5.

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] setuptools in 2.5.

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] Distutils thoughts

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] Why are contexts also managers? (was r45544 - peps/trunk/pep-0343.txt)

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] setuptools in 2.5.

2006-04-21 Thread Greg Ewing
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/

Re: [Python-Dev] Distutils thoughts

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] [Python-3000-checkins] r45617 - in python/branches/p3yk/Lib/plat-mac/lib-scriptpackages: CodeWarrior/CodeWarrior_suite.py CodeWarrior/__init__.py Explorer/__init__.py Finder/Container

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] Google Summer of Code proposal: improvement of long int and adding new types/modules.

2006-04-21 Thread Greg Ewing
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.

Re: [Python-Dev] Why are contexts also managers? (was r45544 - peps/trunk/pep-0343.txt)

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] Google Summer of Code proposal: improvement of long int and adding new types/modules.

2006-04-21 Thread Greg Ewing
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

Re: [Python-Dev] elimination of scope bleeding of iteration variables

2006-05-01 Thread Greg Ewing
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

Re: [Python-Dev] More on contextlib - adding back a contextmanager decorator

2006-05-01 Thread Greg Ewing
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

Re: [Python-Dev] More on contextlib - adding back a contextmanager decorator

2006-05-01 Thread Greg Ewing
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

Re: [Python-Dev] elimination of scope bleeding ofiteration variables

2006-05-01 Thread Greg Ewing
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

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-05-02 Thread Greg Ewing
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

Re: [Python-Dev] elimination of scope bleeding ofiteration variables

2006-05-02 Thread Greg Ewing
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

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-05-02 Thread Greg Ewing
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

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-05-03 Thread Greg Ewing
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

Re: [Python-Dev] Alternative path suggestion

2006-05-04 Thread Greg Ewing
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

Re: [Python-Dev] Alternative path suggestion

2006-05-04 Thread Greg Ewing
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

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-05-04 Thread Greg Ewing
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

Re: [Python-Dev] Python sprint mechanics

2006-05-06 Thread Greg Ewing
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

Re: [Python-Dev] Alternative path suggestion

2006-05-06 Thread Greg Ewing
(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

Re: [Python-Dev] Alternative path suggestion

2006-05-06 Thread Greg Ewing
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/

Re: [Python-Dev] Alternative path suggestion

2006-05-06 Thread Greg Ewing
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

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-05-07 Thread Greg Ewing
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

Re: [Python-Dev] PEP 3101 Update

2006-05-07 Thread Greg Ewing
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 _

Re: [Python-Dev] PyThreadState_SetAsyncExc, PyErr_Clear and native extensions

2006-05-11 Thread Greg Ewing
_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.)

Re: [Python-Dev] PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Greg Ewing
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():

Re: [Python-Dev] PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Greg Ewing
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:/

Re: [Python-Dev] PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Greg Ewing
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

Re: [Python-Dev] PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Greg Ewing
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

Re: [Python-Dev] PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Greg Ewing
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

Re: [Python-Dev] PEP-xxx: Unification of for statement and list-comp syntax

2006-05-22 Thread Greg Ewing
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

Re: [Python-Dev] replace on empty strings

2006-05-24 Thread Greg Ewing
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

Re: [Python-Dev] Cost-Free Slice into FromString constructors--Long

2006-05-25 Thread Greg Ewing
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.

Re: [Python-Dev] A Horrible Inconsistency

2006-05-25 Thread Greg Ewing
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

Re: [Python-Dev] epoll implementation

2006-05-26 Thread Greg Ewing
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

Re: [Python-Dev] epoll implementation

2006-05-27 Thread Greg Ewing
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

Re: [Python-Dev] [Python-checkins] This

2006-05-27 Thread Greg Ewing
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

Re: [Python-Dev] ssize_t: ints in header files

2006-05-29 Thread Greg Ewing
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

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-29 Thread Greg Ewing
), "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

Re: [Python-Dev] Python Benchmarks

2006-06-02 Thread Greg Ewing
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

Re: [Python-Dev] Python Benchmarks

2006-06-02 Thread Greg Ewing
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 ___

Re: [Python-Dev] Stdlib Logging questions (PEP 337 SoC)

2006-06-06 Thread Greg Ewing
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

Re: [Python-Dev] Is "t#" argument format meant to be char buffer, or just read-only?

2006-06-08 Thread Greg Ewing
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

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-09 Thread Greg Ewing
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

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-09 Thread Greg Ewing
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

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-09 Thread Greg Ewing
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

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-09 Thread Greg Ewing
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/

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-10 Thread Greg Ewing
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

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-10 Thread Greg Ewing
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

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-10 Thread Greg Ewing
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

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-10 Thread Greg Ewing
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 ___

Re: [Python-Dev] Switch statement

2006-06-10 Thread Greg Ewing
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

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-11 Thread Greg Ewing
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

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-11 Thread Greg Ewing
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

Re: [Python-Dev] Switch statement

2006-06-11 Thread Greg Ewing
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 ___

Re: [Python-Dev] Switch statement

2006-06-11 Thread Greg Ewing
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:

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-12 Thread Greg Ewing
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

Re: [Python-Dev] Switch statement

2006-06-12 Thread Greg Ewing
[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

Re: [Python-Dev] Switch statement

2006-06-12 Thread Greg Ewing
[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

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-13 Thread Greg Ewing
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

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-13 Thread Greg Ewing
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 _

Re: [Python-Dev] Switch statement

2006-06-15 Thread Greg Ewing
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

Re: [Python-Dev] Dropping externally maintained packages (Was: Please stop changing wsgiref on the trunk)

2006-06-18 Thread Greg Ward
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

Re: [Python-Dev] Switch statement

2006-06-20 Thread Greg Ewing
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/

Re: [Python-Dev] Switch statement

2006-06-20 Thread Greg Ewing
;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

Re: [Python-Dev] Switch statement

2006-06-20 Thread Greg Ewing
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

Re: [Python-Dev] Switch statement

2006-06-20 Thread Greg Ewing
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

Re: [Python-Dev] Switch statement

2006-06-20 Thread Greg Ewing
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

Re: [Python-Dev] Switch statement

2006-06-20 Thread Greg Ewing
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

Re: [Python-Dev] Switch statement

2006-06-22 Thread Greg Ewing
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,

Re: [Python-Dev] Switch statement

2006-06-22 Thread Greg Ewing
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

Re: [Python-Dev] Switch statement

2006-06-24 Thread Greg Ewing
= 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/

Re: [Python-Dev] Switch statement

2006-06-25 Thread Greg Ewing
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

Re: [Python-Dev] ImportWarning flood

2006-06-25 Thread Greg Ewing
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

Re: [Python-Dev] Alternatives to switch?

2006-06-25 Thread Greg Ewing
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

Re: [Python-Dev] Semantic of isinstance

2006-06-26 Thread Greg Ewing
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,

<    18   19   20   21   22   23   24   25   >