Re: Nesting Custom Errors in Classes

2019-07-23 Thread Cameron Simpson
On 24Jul2019 11:47, DL Neil wrote: On 24/07/19 10:07 AM, Cameron Simpson wrote: On 24Jul2019 07:21, DL Neil wrote: ... Get some linting tools. They're great for catching this kind of error. SublimeText has SublimeLinter and PycodeStyle installed, but I'm still familiarising myself with ST

Re: Nesting Custom Errors in Classes

2019-07-23 Thread DL Neil
On 24/07/19 10:07 AM, Cameron Simpson wrote: On 24Jul2019 07:21, DL Neil wrote: ... Get some linting tools. They're great for catching this kind of error. SublimeText has SublimeLinter and PycodeStyle installed, but I'm still familiarising myself with ST. Nothing is reported. Any advice/c

Re: Nesting Custom Errors in Classes

2019-07-23 Thread Cameron Simpson
On 24Jul2019 07:21, DL Neil wrote: Accordingly, the idea that there would be a ClassyThing() but it might be quite different from another ClassyThing() just makes me shudder! (sorry, I guess it's that sheltered upbringing ... again!) It needn't be very different on the outside. The whole poin

Re: Embedding Python in C

2019-07-23 Thread Stefan Behnel
Jesse Ibarra schrieb am 22.07.19 um 18:12: > On Saturday, July 20, 2019 at 1:11:51 PM UTC-6, Stefan Behnel wrote: >> Jesse Ibarra schrieb am 20.07.19 um 04:12: >>> Sorry, I am not understanding. Smalltlak VW 8.3 does not support Python. >>> I can only call Pyhton code through C/Python API. >> >> Ok

Re: Nesting Custom Errors in Classes

2019-07-23 Thread DL Neil
On 23/07/19 11:55 PM, Cameron Simpson wrote: On 23Jul2019 14:54, DL Neil wrote: Do you use nested classes? Python manages nested classes. I've NEVER seen such 'in the wild'. (but perhaps I lead a sheltered life?) So sheltered :-) Well, over here there aren't the venomous creatures you live

Re: Nesting Custom Errors in Classes

2019-07-23 Thread Rob Gaddi
On 7/22/19 7:54 PM, DL Neil wrote: Do you use nested classes? [following-on from the earlier, "Namespaces: memory vs 'pollution'" discussion thread, wherein a certain 'someone' remembered to from ... import ... as ... an 'action' class but forgot to also import the related custom error class!

Re: Creating time stamps

2019-07-23 Thread Peter Pearson
On Mon, 22 Jul 2019 16:25:32 -0500, Michael F. Stemper wrote: > On 22/07/2019 15.58, Chris Angelico wrote: >> On Tue, Jul 23, 2019 at 6:34 AM Michael F. Stemper >> wrote: >>> [snip] >>> from datetime import datetime >>> from time import strftime >>> timestamp = datetime.now().strftime( "%Y-%

Re: Namespaces: memory vs 'pollution'

2019-07-23 Thread Ethan Furman
On 07/22/2019 08:12 PM, DL Neil wrote: On 22/07/19 9:40 PM, Thomas Jollans wrote: Just FYI, in the scientific Python community certain short abbreviations are the norm. Many modules have a ‘standard’ abbreviation that most people use, minimizing confusion. import numpy as np import matplotlib

Re: Namespaces: memory vs 'pollution'

2019-07-23 Thread Ethan Furman
On 07/22/2019 07:27 PM, DL Neil wrote: NameError conveys nothing to the user. PythonVersionError is more communicative - and speaks volumes to 'us'. The mainline code is something like: p = PythonEnvironment() try:     p.compatibility( ...spec... )    # eg must be Py3 not 2.n  

Re: How to execute shell command in Python program?

2019-07-23 Thread Madhavan Bomidi
Thanks for your suggestions. I have sorted the issue as follows: import pexpect child = pexpect.spawn('./opac') child.sendline('opac') This works!!! -- https://mail.python.org/mailman/listinfo/python-list

Re: Nesting Custom Errors in Classes

2019-07-23 Thread Cameron Simpson
On 23Jul2019 14:54, DL Neil wrote: Do you use nested classes? Python manages nested classes. I've NEVER seen such 'in the wild'. (but perhaps I lead a sheltered life?) So sheltered :-) In my experience it's uncommon. I've done it a few times. "Nested" classes aren't anything very special; t

Re: Namespaces: memory vs 'pollution'

2019-07-23 Thread Thomas Jollans
On 23/07/2019 04.27, DL Neil wrote: > On 23/07/19 11:00 AM, Ethan Furman wrote: >> On 07/20/2019 05:02 PM, DL Neil wrote: >> >>> Upon closer inspection, I realised it didn't just fail; it failed >>> badly! Some silly, little, boy had imported the PythonEnvironment >>> class but failed to ALSO impor

Re: Namespaces: memory vs 'pollution'

2019-07-23 Thread Rhodri James
On 23/07/2019 03:27, DL Neil wrote: On 23/07/19 11:00 AM, Ethan Furman wrote: On 07/20/2019 05:02 PM, DL Neil wrote: Upon closer inspection, I realised it didn't just fail; it failed badly! Some silly, little, boy had imported the PythonEnvironment class but failed to ALSO import PythonVersio

Re: PyPi twine check does not like my README.rst files anymore

2019-07-23 Thread Barry Scott
I tried the twine check on Fedora and the test pass. This looks looks like a bug in twine on Windows which I have reported in https://github.com/pypa/twine/issues/476 Barry -- https://mail.python.org/mailman/listinfo/python-list

Hermetic environments

2019-07-23 Thread DL Neil
Is Python going 'the right way' with virtual environments? Warning: this post may contain Python-heresy. I don't use any of the Python virtual environments! I'm not an *ops person either - unless Ops happened to be included within a wider department. However, in attempting to follow the "Prop