On 10/28/2012 09:09 PM, Michael Schumacher wrote:
Von: Donald Miller
Can't directly save to jpg, so exported.
Export to jpg made png. Same for psd.
Shouldn't name track chosen format, so no manual override needed?
Maybe you had set the file-type chooser to this format?
The default "By extension
On Sunday, October 28, 2012 9:26:01 PM UTC-7, Ian wrote:
> On Sun, Oct 28, 2012 at 10:00 PM, Andrew wrote:
>
> > Hi Ian,
>
> > Well, no it really isn't equivalent.
>
> > Consider a programmer who writes:
>
> > xrange(-4,3) *wants* [-4,-3,-2,-1,0,1,2]
>
> >
>
> > That is the "idea" of a range
On Sunday, October 28, 2012 10:14:03 PM UTC-7, Paul Rubin wrote:
> Andrew writes:
>
> > So: Why does python choose to convert them to positive indexes, and
>
> > have slice operate differently than xrange
>
>
>
> There was a thread a few years back, I think started by Bryan Olson,
>
> that m
On Mon, Oct 29, 2012 at 12:54 AM, Andrew wrote:
> On Sunday, October 28, 2012 9:26:01 PM UTC-7, Ian wrote:
>> On Sun, Oct 28, 2012 at 10:00 PM, Andrew wrote:
> The slice class when passed to __getitem__() was created to merely pass two
> numbers and a stride to __getitem__; As far as I know s
On Sunday, October 28, 2012 9:44:56 PM UTC-7, alex23 wrote:
> On Oct 29, 2:09 pm, Andrew wrote:
>
> > I use this arbitrary range code *often* so I need a general purpose
> > solution.
>
> > I looked up slice() but the help is of no use, I don't even know how I might
>
> > overload it to embed
On Mon, Oct 29, 2012 at 1:08 AM, wrote:
> On Sunday, October 28, 2012 10:14:03 PM UTC-7, Paul Rubin wrote:
>> Andrew writes:
> I'm getting very frustrated with the editor provided for this group... It
> keeps posting prematurely, and putting my email in even when I tell it not to
> each time;
On Mon, Oct 29, 2012 at 1:24 AM, wrote:
> On Sunday, October 28, 2012 9:44:56 PM UTC-7, alex23 wrote:
>> On Oct 29, 2:09 pm, Andrew wrote:
>> class RangedSlicer(list):
>> Then wrap your lists with your RangedSlicer class as needed.
>
> Hmmm...
>
> I began a test in an interactive shell:
>>
On Monday, October 29, 2012 1:38:04 AM UTC-7, Chris Rebert wrote:
> On Mon, Oct 29, 2012 at 1:24 AM,
>
> > On Sunday, October 28, 2012 9:44:56 PM UTC-7, alex23 wrote:
>
> >> On Oct 29, 2:09 pm, Andrew < wrote:
>
> You never wrapped `a` in a RangedSlicer or otherwise made use of RangedSlicer!
>
On 29/10/2012 08:59, andrewr3m...@gmail.com wrote:
Note: I subscribed to the python-list, and am able to recieve e-mails, but I
don't see how to write a post for this particular thread nor subscribe to this
particular thread...
A brief suggestion, or link to a howto would be *much* appreciate
Ok, hopefully this is better. I love my own e-mail editor...
I can see that the slice() function can pass in arbitrary arguments.
I'm not sure for lists, which is what the range is applied to, why an
argument like "a" would be part of a slice.
I *really* don't see what the advantage of a slice
On 29/10/2012 02:31, Andrew Robinson wrote:
Ok, hopefully this is better. I love my own e-mail editor...
I can see that the slice() function can pass in arbitrary arguments.
I'm not sure for lists, which is what the range is applied to, why an
argument like "a" would be part of a slice.
I *real
On Mon, 29 Oct 2012 01:59:06 -0700, andrewr3mail wrote:
> Note: I subscribed to the python-list, and am able to recieve e-mails,
> but I don't see how to write a post for this particular thread nor
> subscribe to this particular thread...
The beauty of email is that you don't have to subscribe to
Am 29.10.2012 00:30, schrieb goldtech:
class Contact:
all_contacts = []
def __init__(self, name, email):
self.name = name
self.email = email
Contact.all_contacts.append(self)
Okay, a class that automatically registers all instances in a central list.
OK,
On Mon, 29 Oct 2012 00:54:29 -0700, Andrew wrote:
> Actually, I said in the OP:
>
> "I also don't understand why slice() is not equivalent to an iterator,
> but can replace an integer in __getitem__() whereas xrange() can't."
Slices and iterators have different purposes and therefore have not be
On Mon, Oct 29, 2012 at 10:19 PM, Steven D'Aprano
wrote:
>> In 'C', where Python is written,
>
> That's a popular misapprehension. Python is written in Java, or Lisp, or
> Haskell, or CLR (dot Net), or RPython, or Ocaml, or Parrot. Each of those
> languages have, or had, at least one Python implem
Hi all,
I haven't quite figured out how to apply a paid ssl cert, say RapidSSL free SSL
test from Python's recent sponsor sslmatrix.com and what to do with that to
make Python happy.
This good fellow suggests using the PEM format. I tried and failed.
http://www.minnmyatsoe.com/category/python-2
On 10/29/2012 04:32 AM, Chris Angelico wrote:
I wonder if what the OP is looking for is not slicing, but something
more akin to map. Start with a large object and an iterator that
produces keys, and create an iterator/list of their corresponding
values. Something like: a=[1,2,3,4,5,6,7,8,9,10]
On 2012-10-28, Devin Jeanpierre wrote:
>>> The 'canonical way'
>>> while True:
>>> line = complex_expression
>>> if not line:
>>> break
>>> do_something_with(line)
>>>
>>> avoids this problem, but I was never really convinced about the beauty /
>>> readbility of this constr
Hello all,
I am very new to python. I am currently porting a little project of mine from
java to python and I need to be able to construct and write png images. I
naturally turned myself toward pypng to accomplish this.
I learned from the net that pypng 0.0.13 is supposed to work in Python 3.x
Hi,
is there a way building an OrderedDict faster?
Thanks in advance
Christian
@timeit
def ordered(n=10):
d = OrderedDict()
for i in xrange(n):
d['key'+str(i)] = i
return d
@timeit
def comprehension(n=10):
d = { 'key'+str(i):i for i in xrange(n) }
return d
On Mon, Oct 29, 2012 at 3:52 PM, Andrew Robinson
wrote:
> I am curious as to how quickly it constructs the result compared to a slice
> operation.
>
> Eg:
> a[1:5]
> vs.
> [ a[i] for i in xrange[1:5] ]
For the most part, don't concern yourself with performance. Go with
functionality and readabili
thank you guys for the huge list of answers,
In my setting I have to access some routers and firewall from a
linux-client.
I think I'll try Fabric.
On 26.10.2012 06:20, Rodrick Brown wrote:
On Oct 25, 2012, at 6:34 AM, Schneider wrote:
Hi Folkz,
how can i create a SSH-Connection with pyth
Am Donnerstag, 25. Oktober 2012 12:31:46 UTC+2 schrieb Schneider:
> Hi Folkz,
>
> how can i create a SSH-Connection with python? I have to send some
>
> commands to the remote host and parse their answers.
>
> greatz Johannes
There is a module in chilkat.
http://www.example-code.com/python/ssh
On 10/29/2012 04:19 AM, Steven D'Aprano wrote:
On Mon, 29 Oct 2012 00:54:29 -0700, Andrew wrote:
Slices and iterators have different purposes and therefore have not been
made interchangeable. Yes, there are certain similarities between a slice
and xrange, but there are also significant differenc
In article ,
Gelonida N wrote:
> The sh module looks intersting, but it's not supported for Windows
> platforms.
"The X module looks interesting but it's not supported for Windows" is
true for many values of X. It's all part of the TCO of using a
brain-dead operating system.
--
http://mail
On 10/29/2012 05:23 AM, icgwh wrote:
Hello all,
I am very new to python. I am currently porting a little project of mine from
java to python and I need to be able to construct and write png images. I
naturally turned myself toward pypng to accomplish this.
I don't know if this will help, but:
I probably should have mentioned that I'm under W7 ultimate x64, I'm using
eclipse Juno (latest) and pydev 2.7.1
--
http://mail.python.org/mailman/listinfo/python-list
That's very kind of you but I don't think it would be particularly fitted to my
needs. The program I'm trying to code creates an image as an 2D array of
"pixels" which is defined by RGBA value. My program needs to access and
modifies every component of every pixels in the image following a set o
On Sun, Oct 28, 2012 at 10:15 AM, Joshua Landau
wrote:
> I feel necessity to argue against this point.
>
> It is a common thing to stereotype teens in this way - but, being teen
> myself, I feel one should try to avoid it. It's painful to watch every time
> someone claims "he can't be a teenager
On Sunday 28 October 2012 16:45:12 GangGreene did opine:
> On Sun, 28 Oct 2012 16:29:07 +, Mark Lawrence wrote:
> > On 13/10/2012 18:49, Santosh Kumar wrote:
> >
> >
> > Try your local garden centre.
>
> I inquired at the local garden centre, Just got strange looks
>
> Are you sure tha
On Mon, Oct 29, 2012 at 5:01 PM, Andrew Robinson
wrote:
> Looking at some of the online programming notes -- a slice apparently
> doesn't use an integer storage variable that is capable of arbitrary
> expansion. =-O -- and hence, won't work for very large sized lists. That
> actually explains so
In article ,
Andrew Robinson wrote:
> Show me an example where someone would write a slice with a negative and
> a positive index (both in the same slice);
> and have that slice grab a contiguous slice in the *middle* of the list
> with orientation of lower index to greater index.
It's possib
Hi all
I'm pleased to announce 2 newly published articles in The Python Papers
(ojs.pythonpapers.org).
FUSE’ing Python for Development of Storage Efficient Filesystem
(http://ojs.pythonpapers.org/index.php/tpp/article/view/244)
Abstract: Filesystem is a core component of a functional operating
On Mon, Oct 29, 2012 at 8:23 AM, wrote:
> Hello all,
>
> I am very new to python. I am currently porting a little project of mine from
> java to python and I need to be able to construct and write png images. I
> naturally turned myself toward pypng to accomplish this.
>
> I learned from the ne
On Sun, Oct 28, 2012 at 4:09 PM, Gelonida N wrote:
> The only thing I'm concerned about paramiko is, that I don't see any
> activity on the paramiko site and that one library it depends on is not
> available is windows binary package for newer versions of python.
>
I don't understand why this is
- Original Message -
> I have a philosofical doubt about immutability, that arised while
> doing
> the SCALA functional programming course.
>
> Now suppose I have a simple NumWrapper class, that very stupidly
> does:
>
> class NumWrapper(object):
> def __init__(self, number):
>
2012/10/29 Jean-Michel Pichavant :
>
> "return NumWrapper(self.number + 1) "
>
> still returns a(nother) mutable object.
>
> So what's the point of all this ?
>
> JM
>
Well sure but it doesn't modify the first object, just creates a new
one. There are in general good reasons to do that, for examp
2012/10/29 andrea crotti :
>>
>
> Well sure but it doesn't modify the first object, just creates a new
> one. There are in general good reasons to do that, for example I can
> then compose things nicely:
>
> num.increment().increment()
>
> or I can parallelize operations safely not caring about th
On 29/10/2012 15:20, andrea crotti wrote:
I have a philosofical doubt about immutability, that arised while doing
the SCALA functional programming course.
Now suppose I have a simple NumWrapper class, that very stupidly does:
class NumWrapper(object):
def __init__(self, number):
s
andrea crotti writes:
> and we want to change its state incrementing the number ...
> the immutability purists would instead suggest to do this:
> def increment(self):
> return NumWrapper(self.number + 1)
Immutability purists would say that numbers don't have "state" and if
you're tr
- Original Message -
> 2012/10/29 Jean-Michel Pichavant :
> >
> > "return NumWrapper(self.number + 1) "
> >
> > still returns a(nother) mutable object.
> >
> > So what's the point of all this ?
> >
> > JM
> >
>
> Well sure but it doesn't modify the first object, just creates a new
> one.
On Tue, Oct 30, 2012 at 2:55 AM, Paul Rubin wrote:
> andrea crotti writes:
>> and we want to change its state incrementing the number ...
>> the immutability purists would instead suggest to do this:
>> def increment(self):
>> return NumWrapper(self.number + 1)
>
> Immutability puris
2012/10/29 Jean-Michel Pichavant :
>
>
> In an OOP language num.increment() is expected to modify the object in place.
> So I think you're right when you say that functional languages technics do
> not necessarily apply to Python, because they don't.
>
> I would add that what you're trying to sugg
2012/10/29 Chris Angelico :
> On Tue, Oct 30, 2012 at 2:55 AM, Paul Rubin wrote:
>> andrea crotti writes:
>>> and we want to change its state incrementing the number ...
>>> the immutability purists would instead suggest to do this:
>>> def increment(self):
>>> return NumWrapper(self
Hi there,
I'm currently looking for a good solution to the following problem: I
have two classes A and B, which interact with each other and which
interact with the user. Instances of B are always created by A.
Now I want A to call some private methods of B and vice versa (i.e. what
C++ "friends"
2012/10/29 Johannes Bauer :
> Hi there,
>
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A to call some private methods of B
On Mon, Oct 29, 2012 at 9:33 AM, Johannes Bauer wrote:
> Hi there,
>
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A to ca
On Sun, Oct 28, 2012 at 10:40 PM, wrote:
> Hello to the group!
>
> I've learned a lot about Ubuntu just trying to install numpy for Python
> 3.2.3. I've finally managed to put it in the Python3.2 directory but when I
> try to import it, I still get there's "no module named numpy." There are
>
On Tue, Oct 30, 2012 at 3:33 AM, Johannes Bauer wrote:
> Hi there,
>
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A to ca
andrea crotti writes:
> Also because how doi I make an immutable object in pure Python?
Numbers in Python are already immutable. What you're really looking for
is a programming style where you don't bind any variable more than once.
This gives rise to a programming style that Python can support
On 2012-10-29, Johannes Bauer wrote:
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A to call some private methods of B an
On 29.10.2012 17:47, Chris Angelico wrote:
> The usual convention for private methods is a leading underscore on the name:
Yup, that's what I'm using.
> It's only a convention, though; it doesn't make it "hard" to call
> them, it just sends the message "this is private, I don't promise that
> it
On 29.10.2012 17:52, Grant Edwards wrote:
> By "decleare them privide" do you mean using __ASDF__ name-munging?
>
> It sounds to me like you're just making life hard on yourself.
Gaah, you are right. I just noticed that using the single underscore
(as I do) does not restrict usage in any "no
Johannes Bauer wrote:
> Now I want A to call some private methods of B and vice versa (i.e. what
> C++ "friends" are), but I want to make it hard for the user to call
> these private methods.
>
> Currently my ugly approach is this: I delare the internal methods
> private (hide from user). Then I
Johannes Bauer writes:
> This makes the source files largish however (they're currently split up
> in different files). Can I use the nested class advantage and somehow
> include the inner class from another file?
You could possibly duck-punch class A:
import B
class A:
...
A.B = B.B
Johannes Bauer wrote:
> On 29.10.2012 17:52, Grant Edwards wrote:
>
>> By "decleare them privide" do you mean using __ASDF__ name-munging?
>>
>> It sounds to me like you're just making life hard on yourself.
>
> Gaah, you are right. I just noticed that using the single underscore
> (as I do
On Oct 29, 2012 7:10 AM, "Andrew Robinson" wrote:
> I will be porting Python 3.xx to a super low power embedded processor
> (MSP430), both space and speed are at a premium.
> Running Python on top of Java would be a *SERIOUS* mistake. .NET won't even
> run on this system. etc.
If that's the ca
On 10/29/2012 8:36 AM, Christian wrote:
Hi,
is there a way building an OrderedDict faster?
Thanks in advance
Christian
@timeit
def ordered(n=10):
d = OrderedDict()
for i in xrange(n):
d['key'+str(i)] = i
return d
try d = OrderedDict(['key'+str(i),i for i in xrange
On Mon, Oct 29, 2012 at 1:54 AM, Andrew wrote:
> My intended inferences about the iterator vs. slice question was perhaps not
> obvious to you; Notice: an iterator is not *allowed* in __getitem__().
Yes, I misconstrued your question. I thought you wanted to change the
behavior of slicing to wra
On 10/29/2012 11:20 AM, andrea crotti wrote:
I have a philosofical doubt about immutability, that arised while doing
the SCALA functional programming course.
In real life, the physical world, things have mutable state, at least
down to the atomic level. Do you only want to model mathematical w
On 10/29/2012 12:05 PM, andrea crotti wrote:
> I meant how do I create new immutables classes myself, I guess that's
> possible writing C extensions but I don't see in pure Python..
The short answer is: you don't, not really, except by using NamedTuple
if that gives you what you want.
The longer
On 10/29/2012 1:05 PM, andrea crotti wrote:
I meant how do I create new immutables classes myself, I guess that's
possible writing C extensions but I don't see in pure Python..
If you mean class with immutable instances, mutate new instances in
__new__ instead of __init__ and write a custom .
On 2012-10-29, Johannes Bauer wrote:
> On 29.10.2012 17:47, Chris Angelico wrote:
>
>> The usual convention for private methods is a leading underscore on the name:
>
> Yup, that's what I'm using.
>
>> It's only a convention, though; it doesn't make it "hard" to call
>> them, it just sends the mes
>
> Do you have the file c:\Python33\Lib\site-packages\pypng-0.0.13-py3.3.egg ?
>
> If not, you have not successfully installed pypng. Please try one of
>
> the methods I gave above.
Yes I do have the egg.
I'm gonna try to summarize:
I don't have installations problems anymore but it seems
On Mon, Oct 29, 2012 at 12:46 PM, Paul Rubin wrote:
> andrea crotti writes:
>> Also because how doi I make an immutable object in pure Python?
>
> Numbers in Python are already immutable. What you're really looking for
> is a programming style where you don't bind any variable more than once.
N
Too bad that's not (using python2.7)
'ordered_dict_generator' ((), {}) 1.089588 sec
Anyway thanks for your hint!
> Hi,
>
>
>
> is there a way building an OrderedDict faster?
>
>
>
> Thanks in advance
>
> Christian
>
>
>
> @timeit
>
> def ordered(n=10):
>
> d = OrderedDict()
>
On Mon, Oct 29, 2012 at 10:58 AM, Johannes Bauer wrote:
> Ah, that's nice. I didn't know that nested classes could access their
> private members naturally (i.e. without using any magic, just with plain
> old attribute access).
There is nothing at all special about nested classes that is differen
On Mon, Oct 29, 2012 at 10:12 AM, andrea crotti
wrote:
> Also because how doi I make an immutable object in pure Python?
I sometimes use namedtuples for this.
from collections import namedtuple
MyImmutableClass = namedtuple('MyImmutableClass', 'field1 field2 field3 field4')
If you want default
On Tue, Oct 30, 2012 at 6:23 AM, Ian Kelly wrote:
> _MyImmutableClass = namedtuple('MyImmutableClass', 'field1 field2
> field3 field4')
>
> class MyImmutableClass(_MyImmutableClass):
Question: Is it clearer to take advantage of the fact that the base
class can be an arbitrary expression?
class M
On Mon, Oct 29, 2012 at 1:36 PM, Chris Angelico wrote:
> Question: Is it clearer to take advantage of the fact that the base
> class can be an arbitrary expression?
>
> class MyImmutableClass(namedtuple('MyImmutableClass', 'field1 field2
> field3 field4')):
>
> You lose the unnecessary temporary a
This Saturday, you have the opportunity of participating in the Python
Bug Day. How would you like to be one of the contributors of Python?
If you have ideas for improving parts of the official documentation, the
standard library, the language itself, or if you have a patch waiting
for a review t
On 10/29/2012 04:18 PM, David Robinow wrote:
On Sun, Oct 28, 2012 at 4:09 PM, Gelonida N wrote:
The only thing I'm concerned about paramiko is, that I don't see any
activity on the paramiko site and that one library it depends on is not
available is windows binary package for newer versions of
On 10/29/2012 02:10 PM, Roy Smith wrote:
In article ,
Gelonida N wrote:
The sh module looks intersting, but it's not supported for Windows
platforms.
"The X module looks interesting but it's not supported for Windows" is
true for many values of X. It's all part of the TCO of using a
brain
On 10/29/2012 06:39 AM, ic...@tagyourself.com wrote:
That's very kind of you but I don't think it would be particularly fitted to my needs.
The program I'm trying to code creates an image as an 2D array of "pixels"
which is defined by RGBA value. My program needs to access and modifies every co
On Mon, 29 Oct 2012 23:40:53 +1100, Chris Angelico wrote:
> On Mon, Oct 29, 2012 at 3:52 PM, Andrew Robinson
> wrote:
>> I am curious as to how quickly it constructs the result compared to a
>> slice operation.
>>
>> Eg:
>> a[1:5]
>> vs.
>> [ a[i] for i in xrange[1:5] ]
>
> For the most part, do
In article ,
Gelonida N wrote:
> On 10/29/2012 02:10 PM, Roy Smith wrote:
> > In article ,
> > Gelonida N wrote:
> >
> >> The sh module looks intersting, but it's not supported for Windows
> >> platforms.
> >
> > "The X module looks interesting but it's not supported for Windows" is
> > true
On Mon, 29 Oct 2012 11:19:38 +, Steven D'Aprano wrote:
> Because xrange represents a concrete sequence of numbers, all three of
> start, end and stride must be concrete, known, integers:
>
> py> xrange(4, None, 2)
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: an i
On 10/29/2012 06:52 AM, Roy Smith wrote:
Show me an example where someone would write a slice with a negative and
a positive index (both in the same slice);
and have that slice grab a contiguous slice in the *middle* of the list
with orientation of lower index to greater index.
It's possible in b
Thomas Rachel wrote:
> Am 26.10.2012 09:49 schrieb Ulrich Eckhardt:
> > Hi!
> >
> > General advise when assembling strings is to not concatenate them
> > repeatedly but instead use string's join() function, because it avoids
> > repeated reallocations and is at least as expressive as any alternativ
On Mon, 29 Oct 2012 17:05:07 +, andrea crotti wrote:
> I meant how do I create new immutables classes myself, I guess that's
> possible writing C extensions but I don't see in pure Python..
Well, you can't *quite* make a truly immutable class in pure-Python,
because if *your* Python code can
On Tue, 30 Oct 2012 06:36:52 +1100, Chris Angelico wrote:
> On Tue, Oct 30, 2012 at 6:23 AM, Ian Kelly
> wrote:
>> _MyImmutableClass = namedtuple('MyImmutableClass', 'field1 field2
>> field3 field4')
>>
>> class MyImmutableClass(_MyImmutableClass):
>
> Question: Is it clearer to take advantage o
On Mon, 29 Oct 2012 17:33:24 +0100, Johannes Bauer wrote:
> Hi there,
>
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A
On Mon, Oct 29, 2012 at 3:30 PM, Steven D'Aprano
wrote:
> On Mon, 29 Oct 2012 17:05:07 +, andrea crotti wrote:
>
>> I meant how do I create new immutables classes myself, I guess that's
>> possible writing C extensions but I don't see in pure Python..
>
> Well, you can't *quite* make a truly i
On 10/29/2012 10:09 AM, Ian Kelly wrote:
On Oct 29, 2012 7:10 AM, "Andrew Robinson" wrote:
I will be porting Python 3.xx to a super low power embedded processor (MSP430),
both space and speed are at a premium.
Running Python on top of Java would be a *SERIOUS* mistake. .NET won't even
run on
Am Sonntag, 28. Oktober 2012 03:27:14 UTC+1 schrieb jann...@gmail.com:
> Hello all,
>
>
>
> I am new to Python and have a problem with the behaviour of the xml parser.
> Assume we have this xml document:
>
>
>
>
>
>
>
>
>
> Title of the first book.
>
>
>
>
On Tue, Oct 30, 2012 at 2:42 AM, Andrew Robinson
wrote:
> No, there was no error at all. Pthon just crashed & exited; not even an
> exception that I can recall. It was if it exited normally!
Can you create a reproducible test case? There's usually a cause to
these sorts of things.
ChrisA
--
On Mon, Oct 29, 2012 at 9:20 AM, Andrew Robinson
wrote:
> FYI: I was asking for a reason why Python's present implementation is
> desirable...
>
> I wonder, for example:
>
> Given an arbitrary list:
> a=[1,2,3,4,5,6,7,8,9,10,11,12]
>
> Why would someone *want* to do:
> a[-7,10]
> Instead of saying
On Mon, 29 Oct 2012 15:20:02 +, andrea crotti wrote:
> I have a philosofical doubt about immutability, that arised while doing
> the SCALA functional programming course.
"Philosophical". Like most words derived from the ancient Greeks, the "F"
sound uses "ph" rather than "f".
> Now suppose
On Mon, Oct 29, 2012 at 9:42 AM, Andrew Robinson
wrote:
> The list was generated in a single pass by many .append() 's, and then
> copied once -- the original was left in place; and then I attempted to slice
> it.
Note that if the list was generated by .appends, then it was copied
more than once.
On Mon, 29 Oct 2012 15:45:59 -0700, Chris Kaynor wrote:
> On Mon, Oct 29, 2012 at 3:30 PM, Steven D'Aprano
> wrote:
>> On Mon, 29 Oct 2012 17:05:07 +, andrea crotti wrote:
>>
>>> I meant how do I create new immutables classes myself, I guess that's
>>> possible writing C extensions but I don'
All,
I need help with a date and time comparison.
Say a user enters a date-n-time and a file on disk. I want to compare the date
and time of the file to the entered date-n-time; if the file is newer than the
entered date-n-time, add the file to a list to process.
How best to do? I have looke
In article ,
Ian Kelly wrote:
> On Mon, Oct 29, 2012 at 9:42 AM, Andrew Robinson
> wrote:
> > The list was generated in a single pass by many .append() 's, and then
> > copied once -- the original was left in place; and then I attempted to slice
> > it.
>
> Note that if the list was generated
On Mon, Oct 29, 2012 at 5:24 PM, Roy Smith wrote:
> I think you're missing the point of "amortized constant time". Yes, the
> first item appended to the list will be copied lg(20,000,000) ~= 25
> times, because the list will be resized that many times(*). But, on
> average (I'm not sure if "aver
On 29 October 2012 23:01, Ian Kelly wrote:
> On Mon, Oct 29, 2012 at 9:20 AM, Andrew Robinson
> wrote:
>> FYI: I was asking for a reason why Python's present implementation is
>> desirable...
>>
>> I wonder, for example:
>>
>> Given an arbitrary list:
>> a=[1,2,3,4,5,6,7,8,9,10,11,12]
>>
>> Why w
On Mon, Oct 29, 2012 at 5:43 PM, Ian Kelly wrote:
> The growth factor is approximately 1.125. "Approximately" because
> there is also a small constant term. The average number of copies per
> item converges on 8.
Of course, that is the *maximum* number of copies. The actual number
could be muc
On Mon, 29 Oct 2012 08:42:39 -0700, Andrew Robinson wrote:
>>> But, why can't I just overload the existing __getitem__ for lists and
>>> not bother writing an entire class?
You say that as if writing "an entire class" was a big complicated
effort. It isn't. It is trivially simple, a single line:
On 10/29/2012 04:13 PM, noydb wrote:
All,
I need help with a date and time comparison.
Say a user enters a date-n-time and a file on disk. I want to compare the date
and time of the file to the entered date-n-time; if the file is newer than the
entered date-n-time, add the file to a list to
In article ,
Ian Kelly wrote:
> On Mon, Oct 29, 2012 at 5:24 PM, Roy Smith wrote:
> > I think you're missing the point of "amortized constant time". Yes, the
> > first item appended to the list will be copied lg(20,000,000) ~= 25
> > times, because the list will be resized that many times(*).
On 2012-10-30 00:04, Gary Herron wrote:
On 10/29/2012 04:13 PM, noydb wrote:
All,
I need help with a date and time comparison.
Say a user enters a date-n-time and a file on disk. I want to compare the date
and time of the file to the entered date-n-time; if the file is newer than the
entere
On 10/29/2012 06:53 AM, Chris Angelico wrote:
Can you provide links to these notes? I'm looking at
cpython/Include/sliceobject.h that has this comment:
/*
A slice object containing start, stop, and step data members (the
names are from range). After much talk with Guido, it was decided to
let
1 - 100 of 116 matches
Mail list logo