[Tim Peters, on the problem at
http://spoj.sphere.pl/problems/SUPPER/
]
>> ...
[EMAIL PROTECTED]
> INCREDIBLE~
> 241433 2005-09-11 04:23:40 Tim Peters accepted 3.44 7096 PYTH
> BRAVO!
It's different now ;-) I added the two lines
import psyco
psyco.full()
and
[Tim Peters, on the problem at
http://spoj.sphere.pl/problems/SUPPER/
]
>> Oh, it's not that bad . I took a stab at a Python program for
>> this, and it passed (3.44 seconds).
>> ...
>> I didn't make any effort to speed this, beyond picking a reasonable
&
[EMAIL PROTECTED]
> ...
> I've gotten bored and went back to one of my other projects:
> reimplementing the Python builtin classes list(), set(), dict(),
> and frozenset() with balanced trees (specifically, counted B-trees
> stored in memory).
>
> In short, this allows list lookup, insertion, delet
[john basha]
> send me the britney nude photos
Because they're a new feature, you'll have to wait for Python 2.5 to
be released.
--
http://mail.python.org/mailman/listinfo/python-list
[John J. Lee]
> ...
> I tried it, and I get the same results as before (the test modules from my
> installed copy of Python are picked up instead of the local copies in
> my CVS checkout's Lib/test, apparently entirely contrary to sys.path).
Try running Python with -vv (that's two letter "v", not
[John J. Lee]
> I'm still puzzled, though. Reading the -vv output, I see that when
> importing test_cookielib (which is currently the only line in my
> regrtest.py -f file), Python doesn't appear to look in Lib/test to
> find module "test.test_cookielib" (the actual string passed by
> regrtest.py
[Frans Englich]
...
> My problem, AFAICT, with using os.walk() the usual way, is that in order to
> construct the /hierarchial/ XML document, I need to be aware of the directory
> depth, and a recursive function handles that nicely; os.walk() simply
> concentrates on figuring out paths to all files
[Ilias Lazaridis]
...
> Let's see:
>
> The process would be:
>
> a) A Python Foundation official states: "of course we accept diversity
> and of course we are intrested that our source-code-base compiles
> directly with MinGW (and other compilers)".
Well, I'm a Director of the Python Software Foun
[Tim Peters]
>> Well, I'm a Director of the Python Software Foundation, and my view is
>> "the more platforms the merrier".
[Ilias Lazaridis]
> I extract: "you are intrested, that the source-code-base compiles
> directly with MinGW (and other compilers)"
[Harald Hanche-Olsen]
> I'm confused. I was going to try linkchecker, and it dies with a
> traceback ending in
>
> File "/usr/local/lib/python2.4/calendar.py", line 32, in _localized_month
>_months = [datetime.date(2001, i+1, 1).strftime for i in range(12)]
> AttributeError: 'module' object h
[André Søreng]
> Given a string, I want to find all ocurrences of
> certain predefined words in that string. Problem is, the list of
> words that should be detected can be in the order of thousands.
>
> With the re module, this can be solved something like this:
>
> import re
>
> r = re.compile("wo
[EMAIL PROTECTED]
> I just read in the 'What's New in Python 2.4' document that the None
> data type was converted to a constant:
> http://python.org/doc/2.4/whatsnew/node15.html
>
> """
> # None is now a constant; code that binds a new value to the name
> "None" is now a syntax error.
> """
>
> S
[Daniel Keep]
> I'm currently working on a Python program, and was wondering if it's
> possible to license the program, some associated tools, and a few other
> libraries I've written under the Python license.
>
> I had a look at the new PSF Python license on the list of OSI-approved
> licenses, bu
[Skip Montanaro]
> ...
> The datetime.date object already exposes a strftime method for
> generating a formatted string output and will create date objects
> from both time.time() output (fromtimestamp) and "proleptic
> Gregorian ordinal"s (fromordinal). Looking at the datetime module
> docs, it's
[Geoffrey <[EMAIL PROTECTED]>]
> I am trying to read data from a file binary file and then unpack the
> data into python variables. Some of the data is store like this;
>
> xbuffer: '\x00\x00\xb9\x02\x13EXCLUDE_CREDIT_CARD'
> # the above was printed using repr(xbuffer).
> # Note that int(0x13) =
[Skip Montanaro]
>>> I think inputs from strings would be much more common.
[Tim Peters]
>> Me too, although it's a bottomless pit.
>>
>> guess-6-intended-meanings-for-1/2/3-before-breakfast-ly y'rs
[Peter Hansen]
> I think Skip was intending that the for
[EMAIL PROTECTED]
> I just came across the slides for Guido van Rossum's "Python
> Regrets" talk, given in 2002. It worries me that much of my Python
> code would be broken if all of his ideas were implemented.
Actually, none of it would break, provided you don't change the Python
implementation y
[Neal D. Becker]
> ...
> Only one problem. Is there any way to access the state of a
> generator externally? In other words, the generator saves all it's
> local variables. Can an unrelated object then query the values of
> those variables? (In this case, to get at intermediate results)
It's
[Mel Wilson]
> :) Seems to:
>
>
> Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> class Eq(object):
> ... def __eq__(self, other):
> ... return True
> ...
> >>> class Neq(Eq
[Bengt Richter]
> Peculiar boundary cases:
>
> >>> 2.0**31-1.0
> 2147483647.0
> >>> int(2147483647.0)
> 2147483647L
> >>> int(2147483647L )
> 2147483647
> >>>
> >>> -2.0**31
> -2147483648.0
> >>> int(-2147483648.0)
> -2147483648L
> >>> int(-2147483648L )
> -2147483648
>
> some kind of one-off err
[Brett C]
>> Anthony Baxter, our ever-diligent release manager, mentioned this past week
>> that Python 2.3.5 will most likely come to fruition some time in January
>> (this is not guaranteed date).
[Roy Smith]
> Interesting. Does that mean that 2.3 and 2.4 will be maintained in
> parallel for a
[Tim Peters]
>> ... there's no promise anywhere, e.g., that Python will return an int
>> whenever it's physically possible to do so.
[Bengt Richter]
> Ok, I understand the expediency of that policy, but what is now the meaning
> of int, in that case? Is it now just a v
[Luis M. Gonzalez]
> I'm confussed...
> Python 2.4 (final) hs been released a few days ago, but now I
> see that Python 2.3.5 is being worked on.
> Why? What does it mean?
Just that enough volunteers exist interested in producing another
bugfix release for the 2.3 line. It will probably be the la
[Daniel 'Dang' Griffith]
>> But the factorial example on the wiki has a defect. It incorrectly
>> calculates factorial(0) as 0, when it should be 1.
[Terry Reedy]
> This is a matter of definition, and definitions apparently differ.
> fact(0) == 0 is a backward projection from the definition f(1)
[Paul McGuire]
...
> >>> print "%.2f" % 1.775
> 1.77
>
> Hmmm, if we rounded, I would have expected 1.775 to round up
> to 1.78.
Platform-dependent. 1.775 isn't exactly representable regardless, but
whether exactly-half-way numbers that are exactly representable round
up or truncate varies across
[Peter Otten]
> What I believe to be a minimal example:
>
>
> import Queue
> import threading
> import time
>
> q = Queue.Queue(4)
>
> def proc():
>while True:
>q.get(1)
>Queue.Queue()
>print "YADDA"
>
> threading.Thread(target=proc).start()
>
> while True:
>pri
[Antoon Pardon]
> I don't see why starting a thread as a side effect of importing is
> bad thread practice. Sure python doesn't cater for it, but IMO
> that seems to be python failing.
Obviously, it's bad practice in Python because it can lead to
deadlocks in Python. It's nearly tautological. Im
["sf" <[EMAIL PROTECTED]>]
>> I have files A, and B each containing say 100,000 lines (each
>> line=one string without any space)
>>
>> I want to do
>>
>> " A - (A intersection B) "
>>
>> Essentially, want to do efficient grep, i..e from A remove those
>> lines which are also present in file B.
[Fredrik Lundh]
>>> bdict = dict.fromkeys(open(bfile).readlines())
>>>
>>> for line in open(afile):
>>>if line not in bdict:
>>>print line,
>>>
>>>
[Tim Peters]
>> Note that an open file is an iterable object, yi
[Jane Austine]
> fromkeys(open(f).readlines()) and fromkeys(open(f)) seem to be
> equivalent.
Semantically, yes; pragmatically, no, in the way explained before.
> When I pass an iterator instance(or a generator iterator) to the
> dict.fromkeys, it is expanded at that moment,
I don't know what "e
[Gabriel Cosentino de Barros]
...
> for root, dirs, files in os.walk('t:\'):
> # -- do stuff
> print "working on", root
> # -- stuff done
>
> print 'DEBUG: dirs =', dirs
> for d in dirs:
> # -- remove archive
>
[Adam DePrince]
> Each iteration of os.walk returns three parameters; one of those,
> dirs, is a list of directories within the current directory pointed at
> by root.
Right.
> Am I correct to assume that you beleve that by changing the
> contents of dir you will affect how os.walk traverses the
[Steven Bethard]
> So I end up writing code like this a fair bit:
>
> map = {}
> for key, value in sequence:
> map.setdefault(key, []).append(value)
>
> This code basically constructs a one-to-many mapping -- each
> value that a key occurs with is stored in the list for that key.
>
> This code'
[Jp Calderone]
...
> The Decimal type seems to define min and max so that NaNs
> can be treated specially, but I glean this understanding from only
> a moment of reading decimal.py. Perhaps someone more well
> informed can declare definitively the purpose of these methods.
To conform to the sema
[Doug Holton]
...
> But I will not be intimidated by the likes of Fredrik Lundh. Trollers
> will be held accountable.
Doug, Doug, Doug. Fredrik isn't a troll. He's a Swede. Trolls are Norwegian.
Lighten up, please. Fredrik is usually terse, and sometimes curt
(although Americans seem to have
[Jaime Wyant]
> I've found that the code below will crash if I don't have the
> PyErr_Clear() function call. Should I always call PyErr_Clear()?
That's not the right approach. Nearly all Python C API calls can
fail. They return a special value if they do, primarily NULL for a
call that returns
[Matthew Thorley]
>> I have got to be the stupidest person on the face of the planet.
[Steve Holden]
> I'll have you know I don't welcome newcomers to this newsgroup
> trying to steal my hard-won reputation, if you don't mind.
In all fairness, Matthew did present evidence to support his claim.
F
[Per Erik Stendahl <[EMAIL PROTECTED]>]
> sdfdsafasd
Generally speaking, yes, but not if you're concerned about Pythons
before 1.5.2 too. If you are, a reasonable workaround is:
try:
sdfdsafasd
except NameError:
pass
else:
True = None is None and 1 != 2
False = None is not None o
[Peter Hansen]
> I'm still trying to understand the behaviour that I'm
> seeing but I'm already pretty sure that it's either
> a bug, or something that would be considered a bug if
> it didn't perhaps avoid even worse behaviour.
>
> Inside the join() method of threading.Thread objects,
> a Conditio
[Philp Smith]
> Does anyone have suggested code for a compact, efficient, elegant, most of
> all pythonic routine to produce a list of all the proper divisors of an
> integer (given a list of prime factors/powers)
If the canonical factorization of N is the product of p_i**e_i, the
number of diviso
[Aahz]
>> "The joy of coding Python should be in seeing short, concise, readable
>> classes that express a lot of action in a small amount of clear code --
>> not in reams of trivial code that bores the reader to death." --GvR
[Sunnan]
> Can anyone please point me to the text that quote was taken
[Paul Rubin]
> I'd like to have a function (or other callable object) that returns
> 0, 1, 2, etc. on repeated calls. That is:
>
>print f() # prints 0
>print f() # prints 1
>print f() # prints 2
># etc.
>
> There should never be any possibility of any number getting returned
[Paul Rubin]
> I'm starting to believe the GIL covers up an awful lot of sloppiness
> in Python.
The GIL is highly exploitable, and much of CPython does exploit it.
If you don't want to exploit it, that's fine: there was always an
obvious approach using an explicit mutex here, and the only thing
[Thomas Gagne]
> Does the Python community think Microsoft's embrace is a good or bad thing?
All things in this world unfold exactly according to Guido's secret
Master Plan. So it depends on whether you think Guido is good or bad.
Members of the Python community are required to think Guido is go
[RickMuller]
> I have to sort a list, but in addition to the sorting, I need to
> compute a phase factor that is +1 if there is an even number of
> interchanges in the sort, and -1 if there is an odd number of
> interchanges.
So you want the parity ("sign") of the associated permutation.
> I coul
[Paul Rubin]
> Writing a sorting function from scratch for this purpose seems like
> reinventing the wheel.
Yup! list.sort() is going to be mounds faster.
> Tim's answer of simply counting the cycles (without having to pay
> attention to their length) is really clever. I didn't realize you coul
[EMAIL PROTECTED]
> I would like to be able to pack/unpack 8-byte longs, ...
Have you tried struct's 'q' or 'Q' format codes?
--
http://mail.python.org/mailman/listinfo/python-list
[Magnus Lie Hetland]
> Just a quick question: Does anyone have a simple way of finding the
> positions (start, end) of the groups in a regexp match? AFAICS, the re
> API can only return the contents...?
Read the docs for match objects, esp. the start(), end(), and span() methods.
--
http://mail.p
[Michael Kearns]
> ...
> Also, I don't believe that just 'owning' MSVC 7.1 is enough. From
> cursory glances at the various redist files, I would also have to ship
> the EULA, and as an end-user (of python) I can't just redistribute the
> files - perhaps I could write a place holder application in
[Steve]
> I have a suggestion/request that will, I think, improve the Python
> documentation.
>
> Currently, the Python documentation in HTML format is stored at URLs
> that change with each new release of Python. That is, for example, the
> documentation for the os module is at
> http://python.or
[Paul Rubin]
> Dumb question from a Windows ignoramus:
>
> I find myself needing to write a Python app (call it myapp.py) that
> uses tkinter, which as it happens has to be used under (ugh) Windows.
> That's Windows XP if it makes any difference.
Nope, the Windows flavor doesn't matter.
> I put a
[Sheila King]
> I have a web app that has been running just fine for several months under
> Python 2.2.2.
>
> We are preparing to upgrade the server to run Python 2.4.1.
>
> However, part of my web app is throwing an error on this code (that has
> previously worked without exception):
>
> >>> time.
[Mike Rovner]
> 3 IS wrong because if you use any not BIG letter after bodyguard on both
> sides, you get extra 'eCQQmSXK\n' which slow me down for 5 minutes.
Get rid of the newlines first.
On level 7, I'm not sure whether there's something more to do, or
whether I'm looking at a bug in how IE di
> I was trying to find out how arithmetic on aware datetimes is "supposed
> to" work, and tested with pytz. When I posted asking why it behaves this
> way I was told that pytz doesn't behave correctly according to the way
> the API was designed.
You were told (by me) that its implementation of tzi
[]
> My context is that I am working on an idea to include utc offsets in
> datetime objects (or on a similar object in a new module), as an
> alternative to something like a "fold" attribute. and since "classic
> arithmetic" is apparently so important,
Love it or hate it, it's flatly impossible t
>>> If there are not, maybe the intended semantics should go
>> > by the wayside and be replaced by what pytz does.
>> Changing anything about default arithmetic behavior is not a
>> possibility. This has been beaten to death multiple times on this
>> mailing list already, and I'm not volunteerin
[Guido]
>> Those pytz methods work for any (pytz) timezone -- astimezone() with a
>> default argument only works for the local time zone.
{Alex]
> That's what os.environ['TZ'] = zonename is for. The astimezone() method
> works for every timezone installed on your system. Try it - you won't even
[Tim]
>> Me too - except I think acceptance of 495 should be contingent upon
>> someone first completing a fully functional (if not releasable)
>> fold-aware zoneinfo wrapping.
[Alex]
> Good idea. How far are you from completing that?
In my head, it was done last week ;-) In real life, I'm runn
[Alex]
>>> I will try to create a zoneinfo wrapping prototype as well, but I will
>>> probably "cheat" and build it on top of pytz.
[Tim]
>> It would be crazy not to ;-) Note that Stuart got to punt on "the
>> hard part": .utcoffset(), since pytz only uses fixed-offset classes.
>> For a prototy
[Alex]
>>I will try to create a zoneinfo wrapping prototype as well, but I will
>>probably "cheat" and build it on top of pytz.
[Laura Creighton]
> My question, is whether it will handle Creighton, Saskatchewan, Canada?
> Creighton is an odd little place. Like all of Saskatchewan, it is
> in the
[Tim]
>> Hi, Laura! By "zoneinfo" here, we mean the IANA (aka "Olson") time
>> zone database, which is ubiquitous on (at least) Linux:
>>
>>https://www.iana.org/time-zones
>>
>>So "will a wrapping of zoneinfo handle XYZ?" isn't so much a question
>>about the wrapping as about what's in the IAN
[Laura]
>>> But I am not sure how it is that a poor soul who just wants to print a
>>> railway schedule 'in local time' is supposed to know that Creighton is
>>> using Winnipeg time.
[Tim]
>> I'm not sure how that poor soul would get a railway schedule
>> manipulable in Python to begin with ;-)
[
[Tim]
>> Whatever time zone the traveler's railroad schedule uses, so long as
>> it sticks to just one
[Laura]
> This is what does not happen. Which is why I have written a python
> app to perform conversions for my parents, in the past.
So how did they get the right time zone rules for Creighto
[Guido]
> Wouldn't it be sufficient for people in Creighton to set their timezone to
> US/Central? IIUC the Canadian DST rules are the same as the US ones. Now,
> the question may remain how do people know what to set their timezone to.
> But neither pytz nor datetime can help with that -- it is up
[Tim]
>> pytz solves it by _never_ creating a hybrid tzinfo. It only uses
>> eternally-fixed-offset tzinfos. For example, for a conceptual zone
>> with two possible total UTC offsets (one for "daylight", one for
>> "standard"), there two distinct eternally-fixed-offset tzinfo objects
>> in pytz.
[Guido]
>> Wouldn't it be sufficient for people in Creighton to set their timezone to
>> US/Central? IIUC the Canadian DST rules are the same as the US ones. Now,
>> the question may remain how do people know what to set their timezone to.
>> But neither pytz nor datetime can help with that -- it i
[Tim]
>> So, on your own machine, whenever daylight time starts or ends, you
>> manually change your TZ environment variable to specify the newly
>> appropriate eternally-fixed-offset zone? Of course not.
[Random832 ]
> No, but the hybrid zone isn't what gets attached to the individual
> struct t
[Tim]
>> It would be nice to have! .utcoffset() is an expensive operation
>> as-is, and being able to rely on tm_gmtoff would make that dirt-cheap
>> instead.
[Alex]
> If it is just a question of optimization,
Yes. If it's more than just that, then 495 doesn't actually solve the
problem of get
[Random832 ]
Whether or not datetimes stored tm_gmtoff and tm_zone workalikes has
no effect on semantics I can see. If, in your view, they're purely an
optimization, they're just a distraction for now. If you're proposing
to add them _instead_ of adding `fold`, no, that can't work, for the
pick
[Tim]
>> It depends on how expensive .utcoffset()
>> is, which in turn depends on how the tzinfo author implements it.
[Alex]
> No, it does not. In most time zones, UTC offset in seconds can be computed
> by C code as a 4-byte integer
Which is a specific implementation of .utcoffset(). Which li
[Random832 ]
> A) I'm still not sure why, but I was talking about adding an int, not a
> timedelta and a string.
>
> B) Older python versions can't make use of either utcoffset or fold, but
> can ignore either of them. I don't even see why they couldn't ignore a
> timedelta and a string if we felt
[Tim]
>> Because all versions of Python expect a very specific pickle layout
>> for _every_ kind of pickled object (including datetimes).. Make any
>> change to the pickle format of any object, and older Pythons will
>> simply blow up (raise an exception) when trying to load the new pickle
>> - or
[Random832 ]
> Would allowing a 16-byte string in the future have increased the storage
> occupied by a 10-byte string today? Would allowing a third argument in
> the future have increased the storage occupied by two arguments today?
> As far as I can tell the pickle format for non-primitive types
[Tim]
>> Sorry, I'm not arguing about this any more. Pickle doesn't work at
>> all at the level of "count of bytes followed by a string".
[Random832 ]
> The SHORT_BINBYTES opcode consists of the byte b'C', followed by *yes
> indeed* "count of bytes followed by a string".
Yes, some individual opc
[François Pinard]
...
> Would someone know where I could find a confirmation that comparing
> dictionaries with `==' has the meaning one would expect (even this is
> debatable!), that is, same set of keys, and for each key, same values?
Yes, look here : it has the meaning you expect, provided tha
[Steve Holden, to bonono]
> ...
> I believe I have also suggested that the phrases of the Zen aren't to be
> taken too literally.
Heretic.
> You seem to distinguish between "obvious" meaning "obvious to Steve
> but not necessarily to me" and "really obvious" meaning "obvious to both
> Steve and m
[Steven D'Aprano]
> I'm looking for some way to get the next floating point number after any
> particular float.
...
> According to the IEEE standard, there should be a routine like next(x,y)
> which returns the next float starting from x in the direction of y.
>
> Unless I have missed something, P
[David MacKay]
> Hello, I'm a python-list newbie. I've got a question about doctest; perhaps
> a bug report.
As things will turn out, it's just a question. That's common for newbies :-)
> I really like doctest, but sometimes doctest gives a failure when the output
> looks absolutely fine to me -
[David MacKay, having fun with doctest]
...
> I've got a follow-up question motivated by my ugly backslash continuations.
[Tim]
>> When Python doesn't "look clean", it's not Python -- and backslash
>> continuation & semicolons often look like dirt to the experienced
>> Python's eye.
> The reason
[Bengt Richter]
> I wonder if frexp is always available,
Yes, `frexp` is a standard C89 libm function. Python's `math` doesn't
contain any platform-specific functions.
...
> The math module could also expose an efficient multiply by a power
> of two using FSCALE if the pentium FPU is there.
`l
[Steven D'Aprano]
> ...
> Will Python always use 64-bit floats?
A CPython "float" is whatever the platform C compiler means by
"double". The C standard doesn't define the size of a double, so
neither does Python define the size of a float.
That said, I don't know of any Python platform to date w
[EMAIL PROTECTED]
> ...
> What about the copyright in CPython ? Can I someone take the codebase
> and make modifications then call it Sneak ?
Of course they _could_ do that, and even without making modifications
beyond the name change. If you want to know whether it's legal,
that's a different q
[Greg Stein]
>>> Guido would acknowledge a query, but never announce it. That's not his
>>> style.
He's been very low-key about it, but did make an informal announcement
on the PSF-Members mailing list.
>>> This should have a positive impact on Python. His job description has a
>>> *very* signifi
[D H]
> ...
> Doesn't the python community already have enough assholes as it is?
The Python Software Foundation may well wish to fund a study on that.
Write a proposal! My wild-ass guess is that, same as most other Open
Source communities, we average about one asshole per member. I'd love
to p
[Steven D'Aprano]
> ...
> As others have pointed out, Python's sort never compares the same objects
> more than once.
Others have pointed it out, and it's getting repeated now, but it's
not true. Since I wrote Python's sorting implementation, it's
conceivable that I'm not just making this up ;-)
[Roy Smith]
> Is there some standard way to signal "not implemented yet" in
> unfinished code?
raise NotImplementedError
That's a builtin exception.
...
--
http://mail.python.org/mailman/listinfo/python-list
Over at
http://spoj.sphere.pl/problems/SIZECON/
the task is to come up with the shortest program that solves a
different problem. There's a twist in this one:
Score equals to size of source code of your program except symbols with
ASCII code <= 32.
So blanks, newlines and tabs aren
[David Murmann]
...
>> second, the build order in "pcbuild.sln" for elementtree seems to be
>> wrong, nant tried to build elementtree before pythoncore (which failed).
>> i fixed this by building elementtree separately.
[Steve Holden]
> Yes, the elementtree module is a new arrival for 3.5, so the
[Bengt Richter]
> ...
> [23:28] C:\pywk\clp\seven\pycontest_01>wc -lc seven_seg.py
> 2136 seven_seg.py
>
> 2 lines, 136 chars including unix-style lineseps (is that cheating on
> windows?)
Na. Most native Windows apps (including native Windows Python) don't
care whether \n or
[Peter Hansen]
>>> What I don't understand is why you _can't_ reopen the NamedTemporaryFile
>>> under Windows when you can reopen the file created by mkstemp (and the
>>> files created by TemporaryFile are created by mkstemp in the first place).
[Lee Harr]
>> Are you saying you tried it and you ac
[jelle]
> I have a function that uses the Numeric module. When I launch the
> function csrss.exe consumes 60 / 70 % cpu power rather than having
> python / Numeric run at full speed. Has anyone encountered this problem
> before? It seriously messes up my Numeric performance.
>
> I'm running 2.4.2 o
[Alec Wysoker]
> Using Python 2.3.5 on Windows XP, I occasionally get OSError: [Errno
> 13] Permission denied when calling os.remove(). This can occur with a
> file that is not used by any other process on the machine,
How do you know that?
> and is created by the python.exe invocation that is t
[Claudio Grondi]
> Let's consider a test source code given at the very end of this posting.
>
> The question is if Python allows somehow access to the bytes of the
> representation of a long integer or integer in computers memory?
CPython does not expose its internal representation of longs at the
[Bengt Richter]
> ...
> [1] BTW, I didn't see the 't' mode in
> http://docs.python.org/lib/built-in-funcs.html
> description of open/file, but I have a nagging doubt about saying it's not
> valid.
> Where did you see it?
't' is a Windows-specific extension to standard C's file modes.
Python pas
[Antoon Pardon]
> I have used unit tests now for a number of project. One thing
> that I dislike is it that the order in which the tests are done
> bears no relationship to the order they appear in the source.
>
> This makes using unit tests somewhat cumbersome. Is there some
> way to forc
[Raymond Hettinger]
> ...
> I scanned the docs for Haskell, SML, and Perl and found that the norm
> for map() and zip() is to truncate to the shortest input or raise an
> exception for unequal input lengths.
> ...
> Also, I'm curious as to whether someone has seen a zip fill-in feature
> employed t
[Antoon Pardon]
> Well maybe unit tests shouldn't care (Thats what I think you meant),
Yup!
> I care. Some methods are vital for the functionality of other methods.
> So it the test for the first method fails it is very likely a number of
> other methods will fail too. However I'm not interrested
[David Rushby]
> Consider the following program (underscores are used to force
> indentation):
>
> import atexit, threading, time
>
> def atExitFunc():
> print 'atExitFunc called.'
>
> atexit.register(atExitFunc)
>
> class T(threading.Thread):
>
[David Rushby]
> ...
> I understand your explanation and can live with the consequences, but
> the atexit docs sure don't prepare the reader for this.
In fact, they don't mention threading.py at all.
> They say, "Functions thus registered are automatically executed upon
> normal interpreter termi
[EMAIL PROTECTED]
> Anyone has any idea on why is there no post/pre increment operators in
> python ?
Maybe because Python doesn't aim at being a cryptic portable assembly
language? That's my guess ;-)
> Although the statement:
> ++j
> works but does nothing
That depends on the type of j, and h
101 - 200 of 363 matches
Mail list logo