Operator precedence problem

2016-06-04 Thread ICT Ezy
>>> 2 ** 3 ** 2 Answer is 512 Why not 64? Order is right-left or left-right? -- https://mail.python.org/mailman/listinfo/python-list

Spread a class over multiple files

2016-06-04 Thread Mark Summerfield
Sometimes I want to spread a class over multiple files. My primary use case is when I create a "Model" class to reflect an entire SQL database. I want a model instance to provide a single point of access to the database, but the database has many tables each requiring its own methods since they

Re: I'm wrong or Will we fix the ducks limp?

2016-06-04 Thread Steven D'Aprano
On Sun, 5 Jun 2016 01:17 pm, Lawrence D’Oliveiro wrote: > On Saturday, June 4, 2016 at 3:55:12 AM UTC+12, Matt Wheeler wrote: >> It's best to think of them as names, rather than variables, as names in >> python don't behave quite how you'll expect variables to if you're coming >> from some other l

Re: for / while else doesn't make sense

2016-06-04 Thread Steven D'Aprano
On Sun, 5 Jun 2016 01:29 pm, Lawrence D’Oliveiro wrote: > On Saturday, June 4, 2016 at 11:37:18 PM UTC+12, Ned Batchelder wrote: >> On Friday, June 3, 2016 at 11:43:33 PM UTC-4, Lawrence D’Oliveiro wrote: >> > On Saturday, June 4, 2016 at 3:00:36 PM UTC+12, Steven D'Aprano wrote: >> > > You can ex

Re: Coding systems are political (was Exended ASCII and code pages)

2016-06-04 Thread Rustom Mody
On Monday, May 30, 2016 at 12:16:55 AM UTC+5:30, Terry Reedy wrote: > On 5/29/2016 2:12 AM, Rustom Mody wrote: > > > In short that a € costs more than a $ is a combination of the factors > > - a natural cause -- there are a million chars to encode (lets assume that > > the > > million of Unicode

Re: Don't put your software in the public domain

2016-06-04 Thread Random832
On Fri, Jun 3, 2016, at 22:02, Steven D'Aprano wrote: > (I am surprised that it takes so little to grant end-user usage > rights, but IANAL and presumably the FSF's lawyers consider that > sufficient. Perhaps there are common law usage rights involved.) Technically, there are statutory usage right

Re: for / while else doesn't make sense

2016-06-04 Thread Lawrence D’Oliveiro
On Saturday, June 4, 2016 at 11:37:18 PM UTC+12, Ned Batchelder wrote: > On Friday, June 3, 2016 at 11:43:33 PM UTC-4, Lawrence D’Oliveiro wrote: > > On Saturday, June 4, 2016 at 3:00:36 PM UTC+12, Steven D'Aprano wrote: > > > You can exit a loop because you have run out of items to process, or you

Re: for / while else doesn't make sense

2016-06-04 Thread Lawrence D’Oliveiro
On Saturday, June 4, 2016 at 9:27:58 PM UTC+12, Steven D'Aprano wrote: > Are you really questioning the need for for-loops to stop iterating > when they reach the end of the sequence or iterator? I just want to point out how you turn a discussion about the behaviour of loops into one about the be

Re: I'm wrong or Will we fix the ducks limp?

2016-06-04 Thread Lawrence D’Oliveiro
On Saturday, June 4, 2016 at 3:55:12 AM UTC+12, Matt Wheeler wrote: > It's best to think of them as names, rather than variables, as names in > python don't behave quite how you'll expect variables to if you're coming > from some other languages. I have made heavy use of Python as well as many oth

Re: Catch exception with message?

2016-06-04 Thread Lawrence D’Oliveiro
On Sunday, June 5, 2016 at 4:44:17 AM UTC+12, Peter Pearson wrote: > ... are you aware that "except Exception" is generally not what you want to > do ... Agree. Always make your “except”-matching as specific as possible. -- https://mail.python.org/mailman/listinfo/python-list

Re: Recommendation for GUI lib?

2016-06-04 Thread John Pote
On 02/06/2016 22:57, Dietmar Schwertberger wrote: On 02.06.2016 12:35, John Pote wrote: I've used wxPython (www.wxpython.org) for a few GUI projects and found it ok. It's a wrapper for the wxWidgets C++ library. There's even a reasonable free GUI builder, wxGlade, which I use as I prefer cons

Re: Don't put your software in the public domain

2016-06-04 Thread Marko Rauhamaa
Terry Reedy : > On 6/4/2016 4:24 AM, Marko Rauhamaa wrote: >> In Finland, it is common for families to have a printed copy of the >> law on the bookshelf. > > How wonderful that 'the law' can fit in a book. Must be abridged, although I'm not sure. >> Families traditionally sort out things like i

Re: Anyone know a donation app codebase?

2016-06-04 Thread Ben Finney
Albert writes: > Anyone knows a donation app whose code is available on github or > similar made in python (could be django, flask, or any other web > framework). Search for Python libraries on the Python Package Index https://pypi.python.org/>. What you are (I think) looking for can be called

Anyone know a donation app codebase?

2016-06-04 Thread Albert
Hello, Anyone knows a donation app whose code is available on github or similar made in python (could be django, flask, or any other web framework). Thank you very much. -- https://mail.python.org/mailman/listinfo/python-list

Re: Don't put your software in the public domain

2016-06-04 Thread Terry Reedy
On 6/4/2016 4:24 AM, Marko Rauhamaa wrote: Paul Rudin : Don't confuse consideration with agreement - they're seperate legal concepts. Agreement is certainly necessary in pretty much all jurisdictions. Consideration is required in most common law jurisdiction (England, the US, most of the commo

Re: Catch exception with message?

2016-06-04 Thread Peter Pearson
On Sat, 4 Jun 2016 04:44:30 +0530, Piyush Verma <114piy...@gmail.com> wrote: > Generally we catch exception using > except Exception as e: > > But sometimes, we see same type of exception is present with different > message.Is there a way to capture same exception with message > filtering? Please h

Re: Multiple inheritance, super() and changing signature

2016-06-04 Thread Nagy László Zsolt
> > Things to know about super: > Part 1 http://www.artima.com/weblogs/viewpost.jsp?thread=236275 > Part 2 http://www.artima.com/weblogs/viewpost.jsp?thread=236278 > Part 3 http://www.artima.com/weblogs/viewpost.jsp?thread=237121 > > The wonders of super: > http://www.artima.com/weblogs/viewpost.j

Re: Multiple inheritance, super() and changing signature

2016-06-04 Thread Steven D'Aprano
On Sat, 4 Jun 2016 09:52 pm, Gregory Ewing wrote: > Ian Kelly wrote: >> >> It can't belong to a subclass; the MRI guarantees that. But it's not >> necessarily a superclass either. > > Er, yes, what I really meant to say was that it could > be a class that got introduced into the MRO as a result

Re: [Q] ImportError by __import__() on Python >= 3.4

2016-06-04 Thread Makoto Kuwata
On Sat, Jun 4, 2016 at 3:15 AM, MRAB wrote: > On 2016-06-03 06:48, Makoto Kuwata wrote: > > On Fri, Jun 3, 2016 at 9:31 AM, MRAB > pyt...@mrabarnett.plus.com>> wrote: >> >> On 2016-06-02 15:04, Makoto Kuwata wrote: >> >> Hi, >> >> I have a trouble around __import__(). >>

Re: for / while else doesn't make sense

2016-06-04 Thread BartC
On 03/06/2016 17:22, Lawrence D’Oliveiro wrote: On Friday, June 3, 2016 at 9:33:32 PM UTC+12, BartC wrote: On 03/06/2016 03:47, Lawrence D’Oliveiro wrote: On Friday, June 3, 2016 at 8:52:52 AM UTC+12, BartC wrote: Simple iterative for-loops are more of a DIY effort... There is one case that

Re: Is there any way to use the logging module adding nothing to a message

2016-06-04 Thread cl
Ben Finney wrote: > c...@isbd.net writes: > > > If I do:- > > > > f = logging.handlers.RotatingFileHandler("/home/chris/tmp/mail.log", > > 'a', 100, 4) > > f.setLevel(logging.DEBUG) > > formatter = logging.Formatter('%(message)s') > > f.setFormatter(formatter) > > log.add

Re: Is there any way to use the logging module adding nothing to a message

2016-06-04 Thread Ben Finney
c...@isbd.net writes: > If I do:- > > f = logging.handlers.RotatingFileHandler("/home/chris/tmp/mail.log", 'a', > 100, 4) > f.setLevel(logging.DEBUG) > formatter = logging.Formatter('%(message)s') > f.setFormatter(formatter) > log.addHandler(f) > > Will I get just the mess

Re: Multiple inheritance, super() and changing signature

2016-06-04 Thread Gregory Ewing
Steven D'Aprano wrote: On Sat, 4 Jun 2016 11:06 am, Gregory Ewing wrote: there is no need to use super. Except then you are precluding others from integrating your classes into their class hierarchies. And if you *do* use super, you're precluding integrating them into other hierarchies that

Re: Multiple inheritance, super() and changing signature

2016-06-04 Thread Gregory Ewing
Ian Kelly wrote: It can't belong to a subclass; the MRI guarantees that. But it's not necessarily a superclass either. Er, yes, what I really meant to say was that it could be a class that got introduced into the MRO as a result of someone else subclassing your class. So when you make a super

Is there any way to use the logging module adding nothing to a message

2016-06-04 Thread cl
I want to use Python to handle the stdout logging that comes from syncthing. When you run syncthing it logs to stdout in a fairly standard format with date, time, ERROR/WARNING/INFO etc. so I don't want to add these. I just want to be able to write the log to a file with appropriate rotation etc.

Re: for / while else doesn't make sense

2016-06-04 Thread Ned Batchelder
On Friday, June 3, 2016 at 11:43:33 PM UTC-4, Lawrence D’Oliveiro wrote: > On Saturday, June 4, 2016 at 3:00:36 PM UTC+12, Steven D'Aprano wrote: > > You can exit a loop because you have run out of items to process, or you can > > exit the loop because a certain condition has been met. > > But why

Re: for / while else doesn't make sense

2016-06-04 Thread Steven D'Aprano
On Sat, 4 Jun 2016 01:41 pm, Lawrence D’Oliveiro wrote: > On Saturday, June 4, 2016 at 2:22:18 PM UTC+12, Steven D'Aprano wrote: >> and a loop with two or more exits a *trivially different* way: >> >> for x in seq: >> do_something() >> if condition: >> break >> if another_cond

Re: I'm wrong or Will we fix the ducks limp?

2016-06-04 Thread Steven D'Aprano
On Sat, 4 Jun 2016 12:50 pm, Christopher Reimer wrote: >> Nor can you uppercase a string until the string exists: >> >> s = "hello world" >> s = s.uppercase() > > >>> s = "hello world".upper() > >>> print(s) > HELLO WORLD "hello world" creates a string. Then you call .upper() on that string.

Re: Don't put your software in the public domain

2016-06-04 Thread Marko Rauhamaa
Paul Rudin : > Don't confuse consideration with agreement - they're seperate legal > concepts. > > Agreement is certainly necessary in pretty much all jurisdictions. > Consideration is required in most common law jurisdiction (England, > the US, most of the commonwealth) but not in many continenta

Re: Don't put your software in the public domain

2016-06-04 Thread Paul Rudin
Lawrence D’Oliveiro writes: > On Friday, June 3, 2016 at 9:53:47 PM UTC+12, Steven D'Aprano wrote: > >> A licence is something like a contract... > > A licence is quite different from a contract. A contract requires some > indication of explicit agreement by both parties, a licence does not. That

Re: Don't put your software in the public domain

2016-06-04 Thread Paul Rudin
Lawrence D’Oliveiro writes: > I wonder about the point of that, though; I have heard of cases where > the judge ruled that the contract had been breached, and awarded > damages of one pound/dollar/euro. So other than winning a symbolic > victory, what was the point? Damages for breach of contra

Re: Don't put your software in the public domain

2016-06-04 Thread Paul Rudin
Nobody writes: > On Fri, 03 Jun 2016 09:15:55 -0700, Lawrence D’Oliveiro wrote: > >>> [quoted text muted] >> >> A licence is quite different from a contract. A contract requires some >> indication of explicit agreement by both parties, a licence does not. > > More precisely, it requires "mutual