Hi:
If I am getting the docs etc. correctly, the string-module is depricated
and is supposed to be removed with the release of Python 3.0.
I still use the module a lot and there are situations in which I don't
know what to do without it. Maybe you can give me some help.
I loved to use
>>> string
Yeeh, I was expecting something like that. The only reason to use map()
at all is for improving the performance.
That is lost when using list comprehensions (as far as I know). So, this
is *no* option for larger jobs.
Andreas
Skip Montanaro wrote:
>>> upper_list = map(string.upper, list_of_st
OK, you won. I read in an (regretably old) guidline for improving
Python's performance that you should prefer map() compared to list
comprehensions. Apparently the performance of list comprehensions has
improved a lot, which is great. (Or the overhead of calling map() got
too big, but I hope th
There has been quite some traffic about mutable and immutable data types
on this list. I understand the issues related to mutable numeric data
types. However, in my special case I don't see a better solution to the
problem.
Here is what I am doing:
I am using a third party library that is perfo
Hi,
How do I find out if NaN, infinity and alike is supported on the current
python platform?
I could do the following:
try:
nan = float('NaN')
have_nan = True
except ValueError:
have_nan = False
Is there an 'official' handle for obtaining this information?
Similar: How do I get the max
/Sébastien Boisgérault wrote:/
> But, practically, I have never found a platform where
> the following fpconst-like code did not work:
>
> import struct
> cast = struct.pack
>
> big_endian = cast('i',1)[0] != '\x01'
> if big_endian:
>nan = cast('d', '\x7F\xF8\x00\x00\x00\x00\x00\x00')[0]
> els
Hi,
If an exception gets raised while I am parsing an input file I would
like to know where (in which line) the error occured. I do not want to
create my own exception class for that purpose and I also do not want to
deal with all possible kinds of exceptions that might occur.
I came up with t
Hi,
I found the following quite cryptic code, which basically reads the
first column of some_file into a set.
In Python I am used to seeing much more verbose/explicit code. However,
the example below _may_ actually be faster than the usual "for line in ..."
Do you consider this code good Python st