Re: Read Firefox sqlite files with Python

2017-11-05 Thread Steve D'Aprano
On Mon, 6 Nov 2017 12:39 am, Paul Moore wrote: > On 5 November 2017 at 01:22, Steve D'Aprano > wrote: >> On Sun, 5 Nov 2017 04:32 am, Steve D'Aprano wrote: >> >>> I'm trying to dump a Firefox IndexDB sqlite file to text using Python 3.5. >>> >>> >>> import sqlite3 >>> con = sqlite3.connect('foo.s

Re: replacing `else` with `then` in `for` and `try`

2017-11-05 Thread Steve D'Aprano
On Sat, 4 Nov 2017 03:57 pm, Michael Torrie wrote: > On 11/03/2017 09:06 PM, Chris Angelico wrote: >> On Sat, Nov 4, 2017 at 1:57 PM, Michael Torrie wrote: >>> On 11/03/2017 07:09 PM, Steve D'Aprano wrote: On Sat, 4 Nov 2017 06:15 am, Michael Torrie wrote: > In fact if you have no b

Re: replacing `else` with `then` in `for` and `try`

2017-11-05 Thread Steve D'Aprano
On Mon, 6 Nov 2017 01:39 am, Jon Ribbens wrote: > On 2017-11-05, Steve D'Aprano wrote: >> On Sat, 4 Nov 2017 04:44 am, Jon Ribbens wrote: >>> That conforms to my model. It's searching for the condition >>> 'count > MAX_OBJECTS'. >> >> That's sounds to me that you are willing to call just about an

Re: replacing `else` with `then` in `for` and `try`

2017-11-05 Thread Chris Angelico
On Mon, Nov 6, 2017 at 11:06 AM, Steve D'Aprano wrote: > On Mon, 6 Nov 2017 10:06 am, Jon Ribbens wrote: > >> On 2017-11-05, Ben Finney wrote: >>> Jon Ribbens writes: I've provided you with a way of thinking about 'for...else' that makes its purpose and meaning intuitively obvious. >>>

Re: replacing `else` with `then` in `for` and `try`

2017-11-05 Thread Steve D'Aprano
On Mon, 6 Nov 2017 10:06 am, Jon Ribbens wrote: > On 2017-11-05, Ben Finney wrote: >> Jon Ribbens writes: >>> I've provided you with a way of thinking about 'for...else' that makes >>> its purpose and meaning intuitively obvious. >> >> I've read that sentence several times, and I still can't mak

Re: replacing `else` with `then` in `for` and `try`

2017-11-05 Thread Ben Finney
Jon Ribbens writes: > On 2017-11-05, Ben Finney wrote: > > Jon Ribbens writes: > >> I've provided you with a way of thinking about 'for...else' that makes > >> its purpose and meaning intuitively obvious. > > > > I've read that sentence several times, and I still can't make it > > anything but

Re: replacing `else` with `then` in `for` and `try`

2017-11-05 Thread Jon Ribbens
On 2017-11-05, Ben Finney wrote: > Jon Ribbens writes: >> I've provided you with a way of thinking about 'for...else' that makes >> its purpose and meaning intuitively obvious. > > I've read that sentence several times, and I still can't make it > anything but a contradiction in terms. Well, kee

Re: replacing `else` with `then` in `for` and `try`

2017-11-05 Thread Ben Finney
Jon Ribbens writes: > I've provided you with a way of thinking about 'for...else' that makes > its purpose and meaning intuitively obvious. I've read that sentence several times, and I still can't make it anything but a contradiction in terms. Something that is “intuitively obvious” surely has

Re: Python Mailing list moderators

2017-11-05 Thread Terry Reedy
On 11/5/2017 4:14 PM, Cameron Simpson wrote: On 05Nov2017 13:09, Στέφανος Σωφρονίου wrote: Folks, More and more nonsense are coming in and I find it really difficult to follow any new post that may come and I have to either search for specific content or scroll down until I hit it by accident

Re: Python Mailing list moderators

2017-11-05 Thread Cameron Simpson
On 05Nov2017 13:09, Στέφανος Σωφρονίου wrote: Folks, More and more nonsense are coming in and I find it really difficult to follow any new post that may come and I have to either search for specific content or scroll down until I hit it by accident. Can we do something about it? It's getting

Python Mailing list moderators

2017-11-05 Thread Στέφανος Σωφρονίου
Folks, More and more nonsense are coming in and I find it really difficult to follow any new post that may come and I have to either search for specific content or scroll down until I hit it by accident. Can we do something about it? It's getting really frustrating :/ Cheers. -- https://mai

Re: [TSBOAPOOOWTDI]using names from modules

2017-11-05 Thread Paul Moore
On 5 November 2017 at 13:54, Stefan Ram wrote: > Paul Moore writes: >>But regardless, the Zen isn't intended to be taken quite as literally >>as the OP was trying to do. It's a statement of principles, not a set >>of rules. > > What I am looking for is a default notation to use in my > beginn

Re: replacing `else` with `then` in `for` and `try`

2017-11-05 Thread Jon Ribbens
On 2017-11-05, Steve D'Aprano wrote: > On Sat, 4 Nov 2017 04:44 am, Jon Ribbens wrote: >> That conforms to my model. It's searching for the condition >> 'count > MAX_OBJECTS'. > > That's sounds to me that you are willing to call just about any test of a > condition inside a loop a "search". I don'

Re: [TSBOAPOOOWTDI]using names from modules

2017-11-05 Thread Steve D'Aprano
On Mon, 6 Nov 2017 12:54 am, Stefan Ram wrote: > Paul Moore writes: >>But regardless, the Zen isn't intended to be taken quite as literally >>as the OP was trying to do. It's a statement of principles, not a set >>of rules. > > What I am looking for is a default notation to use in my > begin

Re: Aw: Try: Except: evaluates to True every time

2017-11-05 Thread Steve D'Aprano
On Sun, 5 Nov 2017 09:53 pm, Karsten Hilbert wrote: > On Sun, Nov 05, 2017 at 11:28:44AM +1100, Steve D'Aprano wrote: > >> > Try in an interactive interpreter: >> > >> >python> "a string" is True >> >> Did you try that yourself? > > Yes, eventually, which is why I corrected myself publicly

Re: Read Firefox sqlite files with Python

2017-11-05 Thread Paul Moore
On 5 November 2017 at 01:22, Steve D'Aprano wrote: > On Sun, 5 Nov 2017 04:32 am, Steve D'Aprano wrote: > >> I'm trying to dump a Firefox IndexDB sqlite file to text using Python 3.5. >> >> >> import sqlite3 >> con = sqlite3.connect('foo.sqlite') >> with open('dump.sql', 'w') as f: >> for line

Re: [TSBOAPOOOWTDI]using names from modules

2017-11-05 Thread Paul Moore
On 5 November 2017 at 01:19, Steve D'Aprano wrote: > On Sun, 5 Nov 2017 06:42 am, Stefan Ram wrote: > >> What is the one way to do it? > > There is no philosophy of "one way to do it" in Python, that is a > misunderstanding (possibly deliberate...) spread about by Perl users, to > contrast Python

Re: Aw: Try: Except: evaluates to True every time

2017-11-05 Thread Karsten Hilbert
On Sun, Nov 05, 2017 at 11:28:44AM +1100, Steve D'Aprano wrote: > > Try in an interactive interpreter: > > > >python> "a string" is True > > Did you try that yourself? Yes, eventually, which is why I corrected myself publicly. However, while it doesn't return True (as I mistakenly suggeste

Re: Zen of Python “obvious way to do it” (was: [TSBOAPOOOWTDI]using names from modules)

2017-11-05 Thread Steve D'Aprano
On Sun, 5 Nov 2017 12:49 pm, Ben Finney wrote: > Steve D'Aprano writes: > >> On Sun, 5 Nov 2017 06:42 am, Stefan Ram wrote: >> >> > What is the one way to do it? >> >> There is no philosophy of "one way to do it" in Python, that is a >> misunderstanding (possibly deliberate...) spread about by P