Re: Pylint false positives

2018-08-16 Thread Steven D'Aprano
On Fri, 17 Aug 2018 08:14:02 +0200, Frank Millman wrote: > How would you extend it without a long chain of > if isinstance(v, str): > [perform checks for str] > elif isinstance(v, int) > [perform checks for int] > etc > etc > > I find that using a separate method per s

Re: Pylint false positives

2018-08-16 Thread Steven D'Aprano
On Wed, 15 Aug 2018 10:44:57 +, Jon Ribbens wrote: > Obviously what I'm objecting to is not the presence of a loop, it's the > presence of many obscure, bodgey and/or broken features all lumped > together: > * using @abstractmethod without metaclass=ABCMeta I'll cop to that one -- it was

Re: Pylint false positives

2018-08-16 Thread Frank Millman
"D'Arcy Cain" wrote in message news:6b4b8587-46c0-19b0-c538-efdf396f0...@vybenetworks.com... On 2018-08-14 04:58 AM, Frank Millman wrote: > As an example, I have a master class defining a unit of data (i.e. the > value of a column) retrieved from a database. I have separate > sub-classes for ea

Re: Program to output a subset of the composite numbers

2018-08-16 Thread tomusatov
Yes, I will try it! Thank you kindly. -- https://mail.python.org/mailman/listinfo/python-list

Re: Program to output a subset of the composite numbers

2018-08-16 Thread tomusatov
I'm sorry I did not correctly state the subset I was after: "Composite numbers that are one less than twice a composite." The output would begin: DATA 15, 27, 35, 39, 49, 50, 51, 55, 63, 65, 69, 75, 77, 87, 91, 95, 99, 111, 115, 119, 123, 125, 129, 135, 143, 147, 153, 155, 159, 161, 169, 17

Re: Program to output a subset of the composite numbers

2018-08-16 Thread tomusatov
Thanks, I think that is an interesting tactic. From there what might the language look like to filter out the composites that are not one less than twice another composite number? -- https://mail.python.org/mailman/listinfo/python-list

Re: Program to output a subset of the composite numbers

2018-08-16 Thread tomusatov
DATA 15, 27, 35, 39, 49, 50, 51, 55, 63, 65, 69, 75, 77, 87, 91, 95, 99, 111, 115, 119, 123, 125, 129, 135, 143, 147, 153, 155, 159, 161, 169, 171, 175, 183, 185, 187, 189, 195, 203, 207, 209, 215, 219, 221 -- https://mail.python.org/mailman/listinfo/python-list

Re: printing to stdout

2018-08-16 Thread Cameron Simpson
On 16Aug2018 22:37, richard lucassen wrote: I can run a shell script from the commandline as root in which I start a python script as user "ha". The output to stdout and stderr generated by the python script is visible in an xterm: #!/bin/dash exec 2>&1 chpst -u ha:ha:i2c -U ha /usr/local/ha/in

printing to stdout

2018-08-16 Thread richard lucassen
I can run a shell script from the commandline as root in which I start a python script as user "ha". The output to stdout and stderr generated by the python script is visible in an xterm: #!/bin/dash exec 2>&1 chpst -u ha:ha:i2c -U ha /usr/local/ha/init.sh exec chpst -u ha:ha:i2c:gpio /usr/local/h

Re: lxml namespace as an attribute

2018-08-16 Thread Skip Montanaro
> You seem to think that you need to take the namespace definitions > from the XML document itself. This is not the case: you can > provide them from whatever soure you want. I was under the impression that XML was a self-describing format. I've been disabused of that notion. Skip -- https://mai

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-16 Thread Thomas Jollans
On 2018-08-16 14:33, Chris Angelico wrote: > On Thu, Aug 16, 2018 at 8:32 PM, Thomas Jollans wrote: >> On 2018-08-16 01:05, Chris Angelico wrote: >>> On Thu, Aug 16, 2018 at 8:51 AM, Cameron Simpson wrote: And as an additional alternative, when I want something weird (extra python args

Re: Pylint false positives

2018-08-16 Thread D'Arcy Cain
On 2018-08-14 04:58 AM, Frank Millman wrote: > "D'Arcy Cain"  wrote in message >> I am also getting a funny smell from your description.  Are you sure >> that you need to redefine the methods?  Perhaps you just need to define >> some class variables and use one method.  You can also define your own

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-16 Thread Chris Angelico
On Thu, Aug 16, 2018 at 8:32 PM, Thomas Jollans wrote: > On 2018-08-16 01:05, Chris Angelico wrote: >> On Thu, Aug 16, 2018 at 8:51 AM, Cameron Simpson wrote: >>> And as an additional alternative, when I want something weird (extra python >>> args or the like) I usually make my script.py into a m

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-16 Thread Thomas Jollans
On 2018-08-16 01:05, Chris Angelico wrote: > On Thu, Aug 16, 2018 at 8:51 AM, Cameron Simpson wrote: >> And as an additional alternative, when I want something weird (extra python >> args or the like) I usually make my script.py into a module and invoke it >> via a shell script, eg: >> >> #!/bin/