Re: WedWonder: Scripts and Modules

2019-09-12 Thread Richard Damon
On 9/12/19 5:11 PM, DL Neil via Python-list wrote: > On 12/09/19 8:22 PM, Barry Scott wrote: > >> In large projects with many modules import with side-effect can make >> for a maintenance >> burden. > > > You seem to have unmasked an assumption under which I operate. (well > done - you know what 't

Re: WedWonder: Scripts and Modules

2019-09-12 Thread Cameron Simpson
On 13Sep2019 08:40, DL Neil wrote: On 12/09/19 10:59 AM, Cameron Simpson wrote: On 12Sep2019 08:24, DL Neil wrote: In this day-and-age do you have a script in live/production-use, which is also a module? What is the justification/use case? Many. Many many. 1: Many of my modules run their u

Re: WedWonder: Scripts and Modules

2019-09-12 Thread DL Neil via Python-list
On 12/09/19 8:22 PM, Barry Scott wrote: On 11 Sep 2019, at 21:24, DL Neil via Python-list wrote: In this day-and-age do you have a script in live/production-use, which is also a module? What is the justification/use case? (discounting distutils and similar installation tools, or unit test

Re: WedWonder: Scripts and Modules

2019-09-12 Thread DL Neil via Python-list
On 12/09/19 10:59 AM, Cameron Simpson wrote: On 12Sep2019 08:24, DL Neil wrote: In this day-and-age do you have a script in live/production-use, which is also a module? What is the justification/use case? Many. Many many. 1: Many of my modules run their unit tests if invoked as the main pro

Re: WedWonder: Scripts and Modules

2019-09-12 Thread Chris Angelico
On Thu, Sep 12, 2019 at 6:57 PM Barry Scott wrote: > As scripts become more complex having it run on import might make debugging > harder > and prevents reuse. > > For example I will import a script at the REPL and examine it and call > function in it to > help me understand and fix problems. H

Re: WedWonder: Scripts and Modules

2019-09-12 Thread Barry Scott
> On 11 Sep 2019, at 21:24, DL Neil via Python-list > wrote: > > In this day-and-age do you have a script in live/production-use, which is > also a module? What is the justification/use case? > > (discounting distutils and similar installation tools, or unit testing > methodology) > > >

Re: WedWonder: Scripts and Modules

2019-09-11 Thread DL Neil via Python-list
On 12/09/19 10:37 AM, Alan Bawden wrote: DL Neil writes: ... However, reversing the question in my mind led me to ask (myself): how many scripts do I have (in "production use") which are ever used (also) as a module by some other script? I think the answer is/was: "none"! Accordingly, (spoiler

Re: WedWonder: Scripts and Modules

2019-09-11 Thread Cameron Simpson
On 12Sep2019 08:24, DL Neil wrote: In this day-and-age do you have a script in live/production-use, which is also a module? What is the justification/use case? Many. Many many. 1: Many of my modules run their unit tests if invoked as the main programme. 2: Several modules are their own uti

Re: WedWonder: Scripts and Modules

2019-09-11 Thread Alan Bawden
DL Neil writes: > ... However, reversing the question in my mind led me to ask (myself): > how many scripts do I have (in "production use") which are ever used > (also) as a module by some other script? I think the answer is/was: > "none"! Accordingly, (spoiler alert: this statement may be heresy

Re: WedWonder: Scripts and Modules

2019-09-11 Thread Chris Angelico
On Thu, Sep 12, 2019 at 7:34 AM DL Neil via Python-list wrote: > > On 12/09/19 8:43 AM, Chris Angelico wrote: > > Yes, absolutely. It's the easiest way to share code between two > > scripts. Here's an example that I created recently: > > > > https://github.com/Rosuav/shed/blob/master/BL1_find_item

Re: WedWonder: Scripts and Modules

2019-09-11 Thread DL Neil via Python-list
On 12/09/19 8:43 AM, Chris Angelico wrote: On Thu, Sep 12, 2019 at 6:34 AM DL Neil via Python-list wrote: In this day-and-age do you have a script in live/production-use, which is also a module? What is the justification/use case? Yes, absolutely. It's the easiest way to share code between

Re: WedWonder: Scripts and Modules

2019-09-11 Thread Chris Angelico
On Thu, Sep 12, 2019 at 6:34 AM DL Neil via Python-list wrote: > > In this day-and-age do you have a script in live/production-use, which > is also a module? What is the justification/use case? > Yes, absolutely. It's the easiest way to share code between two scripts. Here's an example that I cre

WedWonder: Scripts and Modules

2019-09-11 Thread DL Neil via Python-list
In this day-and-age do you have a script in live/production-use, which is also a module? What is the justification/use case? (discounting distutils and similar installation tools, or unit testing methodology) There are over 500 questions on StackOverflow which refer to Python's if _