Nick Coghlan wrote:
> Kevin Jacobs <[EMAIL PROTECTED]> wrote:
>> Try this at home:
>> import collections
>> d=collections.defaultdict(int)
>> d.iterkeys().next() # Seg fault
>> d.iteritems().next() # Seg fault
>> d.itervalues().next() # Fine and dandy
>
> This all worked fine for me in rev 46739
Kevin Jacobs <[EMAIL PROTECTED]> wrote:
> Try this at home:
> import collections
> d=collections.defaultdict(int)
> d.iterkeys().next() # Seg fault
> d.iteritems().next() # Seg fault
> d.itervalues().next() # Fine and dandy
This all worked fine for me in rev 46739 and 46849 (Kubuntu 6.06, gcc 4.0
Fred L. Drake, Jr. wrote:
> On Saturday 10 June 2006 12:34, Fredrik Lundh wrote:
> > if all undocumented modules had as much documentation and articles as
> > ET, the world would be a lot better documented ;-)
> >
> > I've posted a text version of the xml.etree.ElementTree PythonDoc here:
>
>
> > Does anybody find this idea interesting?
>
> Yes, although I wouldn't want an interface taking in strings but something
> more like an iterator that returns each row which itself contains int
> triples. In other words more array-based than string based.
I agree that arrays would be semantical
Noam Raphael wrote:
> I hope that my (hopefully) better explanation made the use case more
> compelling, but I want to add two points in favour of an empty tuple:
I guess I'm really only -0 on the idea of x[] invoking x.__getitem__(), and
allowing the class to decide whether or not to define a de
[Greg Ewing]
> But isn't the problem with the Twister that for *some
> initial states* the period could be much *shorter* than
> the theoretical maximum?
>
> Or is the probability of getting such an initial state
> too small to worry about?
The Twister's state is held in a vector of 624 32-bit wor
On Sat, Jun 10, 2006 at 05:53:14PM -0500, [EMAIL PROTECTED] wrote:
> * Aside from the modified Grammar file there is no documentation.
> * There are no test cases.
> * Can you submit a patch on SourceForge?
All have been addressed, although I'm not sure if I've covered
everywhere I nee
On Jun 10, 2006, at 4:35 PM, Brett Cannon wrote:On 6/10/06, Johann C. Rocholl <[EMAIL PROTECTED]> wrote: I'm working on simple module to write PNG image files in pure python.Adding it to the standard library would be useful for people who wantto create images on web server installations without gd
Greg> Before accepting this, we could do with some debate about the
Greg> syntax. It's not a priori clear that C-style switch/case is the
Greg> best thing to adopt.
Oh sure. That debate should probably leverage PEP 275.
Skip
___
Python-Dev
> "Greg" == Greg Ewing <[EMAIL PROTECTED]> writes:
Greg> A generator with only N possible internal states can't
Greg> possibly result in more than N different outcomes from
Greg> any algorithm that uses its results.
I don't mean to pick nits, but I do find this a bit too general.
Suppose you
> > And from a syntax perspective, it's a bad idea. x[] is much
> > more often a typo than an intentional attempt to index a
> > zero-dimensional array.
>
> but how often is it a typo?
>
> for example, judging from c.l.python traffic, forgetting to add a return
> statement is a quite common, but I
[EMAIL PROTECTED] wrote:
> switch raw_input("enter a, b or c: "):
> case 'a':
> print 'yay! an a!'
> case 'b':
> print 'yay! a b!'
> case 'c':
> print 'yay! a c!'
> else:
> print 'hey dummy! I said a, b or c!'
Bef
Terry Jones wrote:
> That doc note should surely be removed. Perhaps it's an artifact from some
> earlier shuffle algorithm.
>
> The current algorithm (which is simple, well known, and which produces all
> permutations with equal probability) only calls the RNG len(x) - 1 times.
It's not a matte
Tim Peters wrote:
> Off the top of my head, then, since the Twister is provably
> equidistributed in 623 dimensions to 32-bit accuracy, I expect it
> should be able to "fairly" generate all permutations of a sequence of
> <= 623 elements (equidistribution in N dimensions implies
> equidistribution
Robert Kern wrote:
> OTOH, isn't the exact PRNG algorithm considered an implementation detail?
It's questionable whether the PRNG being used *should* be
an implementation detail. To anyone who cares even a little
bit about its quality, knowing the algorithm (or at least
some info about it, such a
On 6/10/06, Johann C. Rocholl <[EMAIL PROTECTED]> wrote:
I'm working on simple module to write PNG image files in pure python.Adding it to the standard library would be useful for people who wantto create images on web server installations without gd and imlib, oron platforms where the netpbm tools
> "Tim" == Tim Peters <[EMAIL PROTECTED]> writes:
Tim> [Terry Jones]
>> and which produces all permutations with equal probability)
Tim> That needs proof. Assuming a true random number generator, such a
Tim> proof is easy. Using a deterministic PRNG, if the period is "too
Tim> short" it's de
Thomas> As the subject of this e-mail says, the attached patch adds a
Thomas> "switch" statement to the Python language.
Thanks for the contribution. I patched my sandbox and it built just fine.
I'm going out of town for a couple weeks, so I'll point out what everyone
else is thinking th
[Terry Jones]
> That doc note should surely be removed. Perhaps it's an artifact from some
> earlier shuffle algorithm.
No, it's an artifact form an earlier PRNG. The shuffle algorithm
hasn't changed.
> The current algorithm (which is simple, well known,
Both true.
> and which produces all pe
Johann C. Rocholl wrote:
> I'm working on simple module to write PNG image files in pure python.
> Adding it to the standard library would be useful for people who want
> to create images on web server installations without gd and imlib, or
> on platforms where the netpbm tools are not easily avail
I'm working on simple module to write PNG image files in pure python.
Adding it to the standard library would be useful for people who want
to create images on web server installations without gd and imlib, or
on platforms where the netpbm tools are not easily available.
Does anybody find this ide
Barry Warsaw wrote:
> On Fri, 9 Jun 2006 09:54:29 -0700
> "Brett Cannon" <[EMAIL PROTECTED]> wrote:
>
>> Do enough people use Google Calendar or a calendar app that support
>> iCal feeds that it would be useful for someone to maintain a Gcal
>> calendar that has the various Python dev related date
That doc note should surely be removed. Perhaps it's an artifact from some
earlier shuffle algorithm.
The current algorithm (which is simple, well known, and which produces all
permutations with equal probability) only calls the RNG len(x) - 1 times.
Terry
___
On Jun 10, 2006, at 1:08 PM, Josiah Carlson wrote:
> Josiah Carlson <[EMAIL PROTECTED]> wrote:
>>
>> Alex Martelli <[EMAIL PROTECTED]> wrote:
>>>
>>> ...claims:
>>>
>>> Note that for even rather small len(x), the total number of
>>> permutations of x is larger than the period of most random numbe
[Alex Martelli]
> ...claims:
>
> Note that for even rather small len(x), the total number of
> permutations of x is larger than the period of most random number
> generators; this implies that "most" permutations of a long
> sequence can never be generated.
>
> Now -- why would the behavior of "mos
Alex Martelli wrote:
> ...claims:
>
> Note that for even rather small len(x), the total number of
> permutations of x is larger than the period of most random number
> generators; this implies that "most" permutations of a long
> sequence can never be generated.
>
> Now -- why would the behavior
An aside before I report this bug:_I_HATE_SOURCEFORGE_. If it doesn't bloody accept anonymous bug reports then it bloody well shouldn't let you type in a nice, detailed, well through-out report and then toss it in the toilet when you hit Submit, and also not allow one dive in after it by using the
On 6/9/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote:
> >4. I believe the order of submodules presented is important and think that
> >they should be listed with 'handlers' and 'simple_server' first:
>
> I agree that the order is important, but I intentionally chose the current
> order to be a g
Josiah Carlson <[EMAIL PROTECTED]> wrote:
>
> Alex Martelli <[EMAIL PROTECTED]> wrote:
> >
> > ...claims:
> >
> > Note that for even rather small len(x), the total number of
> > permutations of x is larger than the period of most random number
> > generators; this implies that "most" permutatio
Thomas> On OS X, this call is not available, but /usr/lib/libc.dylib has
Thomas> a uuid_generate function which is apparently compatible to the
Thomas> linux example I posted above.
Confirmed:
% python
Python 2.5a2 (trunk:46644M, Jun 4 2006, 10:58:16)
[GCC 4.0.0 (Apple
Paul Moore wrote:
> On 6/10/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote:
>> ...so i looked at PEAK's getnodeid48() routine and borrowed the
>> Win32 calls from there, with a comment giving attribution to PEAK.
>
> Instead of using pywin32, could you use ctypes, as that's part of core
> Python? It lo
On 10-jun-2006, at 21:32, Aahz wrote:
> On Sat, Jun 10, 2006, Ronald Oussoren wrote:
>>
>> Hopefully Python 2.5 will see more testing on the mac because there
>> will be prompt binary releases of the betas this time around.
>
> If there is in fact a binary beta release for OS X, there will
> defi
Alex Martelli <[EMAIL PROTECTED]> wrote:
>
> ...claims:
>
> Note that for even rather small len(x), the total number of
> permutations of x is larger than the period of most random number
> generators; this implies that "most" permutations of a long
> sequence can never be generated.
[snip]
> I
On Sat, Jun 10, 2006, Ronald Oussoren wrote:
>
> Hopefully Python 2.5 will see more testing on the mac because there
> will be prompt binary releases of the betas this time around.
If there is in fact a binary beta release for OS X, there will
definitely be testing because we need to double-chec
Phillip J. Eby wrote:
> At 06:39 PM 6/10/2006 +0200, Thomas Heller wrote:
>>I don't know if this is the uuidgen you're talking about, but on linux there
>>is libuuid:
>>
>> >>> from ctypes import *
>> >>> lib = CDLL("libuuid.so.1")
>> >>> uuid = create_string_buffer(16)
>> >>> lib.uuid_generate(byr
Just noticed that, at least on Windows, test_wsgiref fails when Python
is run with -O (but passes without -O):
$ python -O -E -tt ../Lib/test/regrtest.py -v test_wsgiref
test_wsgiref
testAbstractMethods (test.test_wsgiref.HandlerTests) ... ok
testBasicErrorOutput (test.test_wsgiref.HandlerTests) .
Hello,
2006/6/10, Nick Coghlan <[EMAIL PROTECTED]>:
> The closest parallel would be with return/yield, as those actually create real
> tuples the same way subscripts do, and allow the expression to be omitted
> entirely.
>
> By that parallel, however, an implicit subscript (if adopted) should be N
On Saturday 10 June 2006 12:34, Fredrik Lundh wrote:
> if all undocumented modules had as much documentation and articles as
> ET, the world would be a lot better documented ;-)
>
> I've posted a text version of the xml.etree.ElementTree PythonDoc here:
Here's a question that we should answer
...claims:
Note that for even rather small len(x), the total number of
permutations of x is larger than the period of most random number
generators; this implies that "most" permutations of a long
sequence can never be generated.
Now -- why would the behavior of "most" random number generators be
Hello,
I'll try to answer the questions in one message. Sorry for not being
able to do it until now.
About the joke - it isn't, I really need it.
About the timing - Of course, I can live with this getting into 2.6,
and I think that I may even be able to stay alive if this were
rejected. I still
At 06:39 PM 6/10/2006 +0200, Thomas Heller wrote:
>I don't know if this is the uuidgen you're talking about, but on linux there
>is libuuid:
>
> >>> from ctypes import *
> >>> lib = CDLL("libuuid.so.1")
> >>> uuid = create_string_buffer(16)
> >>> lib.uuid_generate(byref(uuid))
>2131088494
> >>> fro
At 11:16 AM 6/10/2006 -0500, Ka-Ping Yee wrote:
>On Sat, 10 Jun 2006, Thomas Heller wrote:
> > [some nice ctypes code]
>
>Done. Works like a charm. Thanks for providing the code!
>
>On Sat, 10 Jun 2006, Phillip J. Eby wrote:
> > Also, for Python 2.5, these imports could probably be replaced with
Phillip J. Eby wrote:
> At 08:22 AM 6/10/2006 -0500, Ka-Ping Yee wrote:
>>Finally, Phillip brought up PEAK:
>> > PEAK's uuid module does this such that if win32all is present,
>> > you get a Windows GUID, or if you have a FreeBSD 5+ or
>> > NetBSD 2+ kernel you use the local platform uuidgen API.
Neal Norwitz wrote:
> There is still the missing documentation for ctypes and element tree.
> I know there's been progress on ctypes. What are we going to do about
> ElementTree? Are we going to have another undocumented module in the
> core
if all undocumented modules had as much documentatio
On 9-jun-2006, at 20:22, Martin v. Löwis wrote:
> Ronald Oussoren wrote:
>> How hard is the feature freeze? Would it be possible to update the
>> Carbon bindings after beta1? Given Apple's focus on backward
>> compatibility the update should only add new functionality, not
>> remove existing func
On Sat, 10 Jun 2006, Thomas Heller wrote:
> [some nice ctypes code]
Done. Works like a charm. Thanks for providing the code!
On Sat, 10 Jun 2006, Phillip J. Eby wrote:
> Also, for Python 2.5, these imports could probably be replaced with a
> ctypes call, though I'm not experienced enough w/ctyp
At 08:22 AM 6/10/2006 -0500, Ka-Ping Yee wrote:
>Finally, Phillip brought up PEAK:
> > PEAK's uuid module does this such that if win32all is present,
> > you get a Windows GUID, or if you have a FreeBSD 5+ or
> > NetBSD 2+ kernel you use the local platform uuidgen API. See e.g.:
>
>...so i looked
On 6/10/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote:
> On Sat, 10 Jun 2006, Paul Moore wrote:
> > Actually, the code uses "ifconfig", which doesn't exist on Windows.
> > You want the command "ipconfig /all".
>
> I fixed that before you posted this message. :)
Give Guido the time machine keys back! :
On Sat, 10 Jun 2006, Paul Moore wrote:
> Actually, the code uses "ifconfig", which doesn't exist on Windows.
> You want the command "ipconfig /all".
I fixed that before you posted this message. :)
-- ?!ng
___
Python-Dev mailing list
Python-Dev@python.o
On Sat, 10 Jun 2006, Thomas Heller wrote:
> I have not tested the speed, but extending my snippet to also work
> on 98 should be nearly trivial:
>
> try:
> _func = windll.rpcrt4.UuidCreateSequential
> except AttributeError:
> _func = windll.rpcrt4.UuidCreate
>
> def CreateGuid():
> uuid
On 6/10/06, Johan Dahlin <[EMAIL PROTECTED]> wrote:
> Ka-Ping Yee wrote:
> > On Thu, 8 Jun 2006, Neal Norwitz wrote:
> >> If you plan to make a checkin adding a feature (even a simple one),
> >> you oughta let people know by responding to this message. Please get
> >> the bug fixes in ASAP. Remem
Ka-Ping Yee wrote:
> Hi Thomas,
>
>> This does not work, for several reasons.
>>
>> 1. (pythoncom|pywintypes).CreateGuid() return a PyIID instance, which you
>> cannot slice:
>
> You're right. The PEAK code must have been based on an earlier
> version of the CreateGuid() routine.
>
> I've fixe
Hi Thomas,
> This does not work, for several reasons.
>
> 1. (pythoncom|pywintypes).CreateGuid() return a PyIID instance, which you
> cannot slice:
You're right. The PEAK code must have been based on an earlier
version of the CreateGuid() routine.
I've fixed this, and added detection of the UU
On 6/10/06, Paul Moore <[EMAIL PROTECTED]> wrote:
> On 6/10/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote:
> > ...so i looked at PEAK's getnodeid48() routine and borrowed the
> > Win32 calls from there, with a comment giving attribution to PEAK.
>
> Instead of using pywin32, could you use ctypes, as th
Ka-Ping Yee wrote:
> Finally, Phillip brought up PEAK:
>> PEAK's uuid module does this such that if win32all is present,
>> you get a Windows GUID, or if you have a FreeBSD 5+ or
>> NetBSD 2+ kernel you use the local platform uuidgen API. See e.g.:
>
> ...so i looked at PEAK's getnodeid48() routi
Ka-Ping Yee wrote:
> On Thu, 8 Jun 2006, Neal Norwitz wrote:
>> If you plan to make a checkin adding a feature (even a simple one),
>> you oughta let people know by responding to this message. Please get
>> the bug fixes in ASAP. Remember to add tests!
>
> Just to make this appear on this thread
On 6/10/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote:
> ...so i looked at PEAK's getnodeid48() routine and borrowed the
> Win32 calls from there, with a comment giving attribution to PEAK.
Instead of using pywin32, could you use ctypes, as that's part of core
Python? It looks like the only Win32 API
Greg Ewing wrote:
> Ka-Ping Yee wrote:
>
>> I think the whole discussion about the concept and meaning of
>> zero-dimensional arrays is mostly irrelevant to the original
>> issue. The original issue is a *syntax* question: should
>> x[()] be written as x[]?
>
> But, at least as presented in the
On Thu, 8 Jun 2006, Neal Norwitz wrote:
> If you plan to make a checkin adding a feature (even a simple one),
> you oughta let people know by responding to this message. Please get
> the bug fixes in ASAP. Remember to add tests!
Just to make this appear on this thread: i'm planning to check in
t
On Sat, 10 Jun 2006, Mike Brown wrote:
> I have a couple of suggestions for improving that implementation:
>
> 1. You're currently using os.urandom, which can raise a NotImplementedError.
> You should be prepared to fall back on a different PRNG...
The latest version (http://zesty.ca/python/uuid.p
Okay. I have done as Fredrik suggested:
> 6. Combine 2 and 3: require the user to pass in a MAC argument
> to uuid1, but provide a SlowGetMacAddress helper that wraps
> the existing code.
I agree with Thomas Wouters:
> That sounds like the right thing to do, although I wou
Neal Norwitz wrote:
> It's June 9 in most parts of the world. The schedule calls for beta 1
> on June 14. That means there's less than 4 days until the expected
> code freeze. Please don't rush to get everything in at the last
> minute. The buildbots should remain green to keep Anthony happy an
Ka-Ping Yee wrote:
> I think the whole discussion about the concept and meaning of
> zero-dimensional arrays is mostly irrelevant to the original
> issue. The original issue is a *syntax* question: should
> x[()] be written as x[]?
But, at least as presented in the PEP, it's a
syntax that was mo
Ka-Ping Yee wrote:
> And from a syntax perspective, it's a bad idea. x[] is much
> more often a typo than an intentional attempt to index a
> zero-dimensional array.
but how often is it a typo?
for example, judging from c.l.python traffic, forgetting to add a return
statement is a quite common
On Sat, 10 Jun 2006, Greg Ewing wrote:
> 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/Numpy are implemented.
I think the whole discussion about the co
Fredrik Lundh wrote:
> Ka-Ping Yee wrote:
>
> > Quite a few people have expressed interest in having UUID
> > functionality in the standard library, and previously on this
> > list some suggested possibly using the uuid.py module i wrote:
> >
> > http://zesty.ca/python/uuid.py
>
> +1!
+1 as
66 matches
Mail list logo