Hello all,
While attempting to make a wrapper for opening multiple types of
UTF-encoded files (more on that later, in a separate post, I guess), I
ran into some oddities with the `codecs` module, specifically to do
with `.register` ing `CodecInfo` objects. I'd like to report a bug or
something, bu
On Wed, May 23, 2012 at 8:23 AM, 水静流深 <1248283...@qq.com> wrote:
s=[1,2,3]
s.append(5)
s
> [1, 2, 3, 5]
s=s.append(5)
s
print s
> None
>
> why can't s=s.append(5) ,what is the reason?
For the same reason that you don't see `[1, 2, 3, 5]` immediately
after doing `s.a
What do you want the contents of the file to look like? Why are you
parsing the XML in the first place? (What do you want to happen if the
data on `sys.stdin` isn't actually valid XML?)
On Thu, May 17, 2012 at 9:52 AM, Nibin V M wrote:
> Hello,
>
> I have the following code, which will assign XM
On Wed, May 9, 2012 at 7:02 AM, J. Mwebaze wrote:
>
> During object instantiaton, i would like to use the specific class, that
> corresponds to the version of the class that was used to create the object.
I don't understand; "the version of the class that was used to create"
**what** object? We'
On Sat, May 12, 2012 at 10:18 AM, Jean-Daniel
wrote:
>> Since you say "intervals" in plural here, I assume that they can overlap?
>
> Yes,
>
> For instance, there are the following intervals :
> [[1, 10],
> [4, 7],
> [6, 15],
> [11, 17]]
>
> asking for the intervals including 5, the returned valu
On Sat, May 12, 2012 at 9:10 AM, Ethan Furman wrote:
>
> Firstly, __slots__ is a tuple.
I object: conceptually, the "slots" of a class are set in stone, but
the `__slots__` attribute of a class object is just an attribute, and
any iterable (as long as it yields valid identifier names) can be used
On Thu, May 10, 2012 at 9:33 AM, Andreas Tawn wrote:
> And there's also something like...
>
> return "\n".join((": ".join((str(k), str(self.__dict__[k]))) for k in
> self.__dict__))
>
> which is a nice length, but I lose control of the order of the attributes and
> the formatting is fixed. It al
On Sat, May 12, 2012 at 8:17 AM, Jean-Daniel
wrote:
> I am looking for a fast way to find the intervals
> containing a given date, without having to check all intervals (less
> than O(n)).
Since you say "intervals" in plural here, I assume that they can overlap?
--
~Zahlman {:>
--
http://mail.
I really wish gmail picked up the mailing list as a default reply-to address...
-- Forwarded message --
From: Karl Knechtel
Date: Sat, May 12, 2012 at 8:25 AM
Subject: Re: Newbie naive question ... int() throws ValueError
To: Devin Jeanpierre
On Sat, May 12, 2012 at 12:11 AM
On Fri, Apr 20, 2012 at 12:43 AM, Chris Angelico wrote:
> On Fri, Apr 20, 2012 at 2:38 PM, alex23 wrote:
>> On Apr 20, 5:54 am, Jacob MacDonald wrote:
>>
>>> On Thursday, April 19, 2012 12:28:50 PM UTC-7, dmitrey wrote:
>>> > can I somehow overload operators like "=>", "->" or something like
>>>
On Thu, Apr 19, 2012 at 3:28 PM, dmitrey wrote:
> hi all,
> can I somehow overload operators like "=>", "->" or something like
> that? (I'm searching for appropriate overload for logical implication
> "if a then b")
> Thank you in advance, D.
> --
> http://mail.python.org/mailman/listinfo/python-l
On Sat, Apr 14, 2012 at 7:26 AM, Tim Chase
wrote:
>
> On 04/13/12 22:54, Chris Angelico wrote:
>>
>> Yes, that would be the right method to use. I'd not bother with the
>> function and map() though, and simply iterate:
>>
>> d = {}
>> for val in l:
>> d.setdefault(f(val), []).append(val)
>
>
> Or
On Sun, Apr 15, 2012 at 5:51 AM, Chris Angelico wrote:
>
> (You may also want to consider using the 'with' statement to guarantee
> a timely closing of the file. Outside the scope of this mail though.)
>
> I think this list is just to collect unique entries, yes? If so, a set
> may be more to you
On Thu, Apr 12, 2012 at 7:15 AM, Tim Golden wrote:
> On 12/04/2012 10:35, Cameron Simpson wrote:
> > I've found myself using a Python gotcha as a feature.
>
> Have a look at Peter Inglesby's lightning talk from a
> recent London Python Dojo:
>
> http://inglesp.github.com/2012/03/24/mutable-defau
Hello all,
Back when I had 2.6.x installed, I used to be able to drag a file onto a
.py file in order to open it with that script (rather, pass the name of the
file as `sys.argv[1]`). I did nothing special to make this work, as far as
I can recall; it was something that the installer set up automa
15 matches
Mail list logo