I was adding __all__ to the random module and I noticed this very unpythonic
example in the module docstring:
>>> g = Random(42) # arbitrary
>>> g.jumpahead(6953607871644L - 1) # move *back* one
Presuming backing up the seed is a reasonable thing to do (I haven't got
much experience with random numbers), why doesn't the Random class have a
jumpback method instead of forcing the user to know the magic number to use
def jumpback(self, n):
return self.jumpahead(6953607871644L - n)
We have a Tkinter-based application that does DNS lookups
(using socket.gethostbyname) in a background thread.
Under 1.5.2, this worked without a hitch. However, under
2.0, the same program tends to lock up on some computers.
I'm not 100% sure (it's a bit hard to debug), but it looks like
a global lock problem...
Any ideas? Is this supposed to work at all?
The O'Reilly Conference Committee needs proposals about a week ago
for the conference in San Diego on July 24th-27th. I think
there should be a short talk on unit testing, showing how
to use PyUnit, Doctest, and Quixote if they have not all
merged into one glorious unified whole by then. I can
do this - we've used PyUnit a lot lately - but have other
talks I'd rather concentrate on.
Is there anyone here who will be there and would like to
give such a talk? I'm sure the committee would
welcome a submission.
CEO and Chief Architect, ReportLab Inc.
Allow me to start off with a personal note. I am no longer @fnal.gov,
I have a new job which is very interesting and challenging but not
particularly Python-related - [my new employer is geodesic.com]
I will have much less time to devote to Python from now on, but I'm
still interested, and since I have access to a lot of unusual hardware
at my new job (Linux/360 anybody?) I am going to try to download and
test alphas and betas as much as time permits.
Along these lines, I tried building the 2.1a2 version on an SMP HP
otto:Python-2.1a2$ uname -a
HP-UX otto B.11.00 U 9000/800 137901547 unlimited-user license
this box has both gcc and the native compiler installed, but not g++.
I tried to configure with the command:
otto:Python-2.1a2$ ./configure --without-gcc
creating cache ./config.cache
checking MACHDEP... hp-uxB
checking for --without-gcc... yes
checking for --with-cxx=<compiler>... no
checking for c++... no
checking for g++... no
checking for gcc... gcc
checking whether the C++ compiler (gcc ) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.
Seems like the "--without-gcc" flag is being completely ignored!
I'll try to track this down as time permits.
I see from one of the comments on my patch #103459 that there
is a history to this issue (patch #103154)
I had assumed that renaming modules and possibly breaking existing
code was not an option, but this seems to have been considered in
the discussion on that earlier patch.
Is there any consensus on how to deal with this ?
I would *really* like to get SOME fix -- either my patch, or a renaming
of FCNTL, TERMIOS, SOCKET, into the next release.
It's not clear to me whether the issues on other systems are the same.
On mac-osx, the OS is BSD unix based and when using a unix file system,
it's case sensitive. But the standard filesystem is Apple's HFS+,
which is case preserving but case insensitive. ( That means that
opening "abc" will succeed if there is a file named "abc", "ABC",
"Abc" , "aBc" ... , but a directory listing will show "abc" )
I had guessed that the CHECK_IMPORT_CASE ifdefs and the corresponding
configure switch were there for this sort of problem, and all I
had to do was add a macosx implementation of check_case(), but
returning false from check_case causes the search to fail -- it
does not continue until it find a matching module.
So it appears that I don't understand the issues on other platforms
and what CHECK_IMPORT_CASE intends to fix.
-- Steve Majewski
Mentioned on c.l.py:
This is the full text of "Advanced Programming Language Design", available
online a chapter at a time in PDF format.
Chapter 2 (Control Structures) has a nice intro to coroutines in Simula and
iterators in CLU, including a funky implementation of the latter via C
macros that assumes you can get away with longjmp()'ing "up the stack"
(i.e., jumping back into a routine that has already been longjmp()'ed out
of). Also an intro to continuations in Io:
CLU iterators are truly elegant. They are clear and expressive.
They provide a single, uniform way to program all loops. They
can be implemented efficiently on a single stack.
Io continuations provide a lot of food for thought. They spring
from an attempt to gain utter simplicity in a programming
language. They seem to be quite expressive, but they suffer
from a lack of clarity. No matter how often I have stared at
the examples of Io programming, I have always had to resort to
traces to figure out what is happening. I think they are just
too obscure to ever be valuable.
Of course in the handful of other languages that support them, continuations
are a wizard-level implementation hook for building nicer abstractions. In
Io you can't even write a loop without manipulating continuations
takes-all-kinds-ly y'rs - tim
I updated the Python 2.1 release schedule (PEP 226):
The schedule now has some realistic future release dates. The plan is
to move to beta 1 before the Python conference, probably issue a
second beta in mid- to late-March, and aim for a final release
sometime in April. The six-week period between first beta and final
release is about as long as the beta period for 2.0, which had many
more significant changes.
I have also added a section on open issues as we had in the 2.0
release schedule. If you are responsible for any major changes or
fixes before the first beta, please add them to that section or send
me mail about them. Remember that we are in feature freeze; only bug
fixes between now and beta 1.
> > Greg Wilson
> > Barbara Fuller at Foretec has set up two mailing lists:
> > Iterator-BOF(a)python9.org (for March 6)
> > Set-BOF(a)python9.org (for March 7)
> > for discussing admin related to these BOFs.
> Guido van Rossum:
> Assuming these aren't mailman lists, how does one subscribe? Or are
> these just aliases that go to a fixed recipient (e.g. you or Barbara)?
The latter --- these are for Barbara's convenience, so that she can get
a feel for how many people will need to be hustled through lunch.
p.s. I have set up http://groups.yahoo.com/group/python-iter and
http://groups.yahoo.com/group/python-sets; Guido, would you prefer
discussion of sets and iterators to be moved to these lists, or to
stay on python-dev?