RE: dangerous class neighborhood

2018-12-27 Thread Avi Gross
Short answer to a short question. What does a dot (dot dot) mean in pseudocode? NOTHING and EVERYTHING. Longer answer: I think what you see may not be what I wrote. I used three dots in a row (an ellipsis) to mean that something is left out to be filled in with something appropria

RE: dangerous class neighborhood

2018-12-27 Thread Avi Gross
Chris, You pretty much did exactly what I expected. You took what I wrote and replaced it with your words and suggested I had said that. What I wrote this time did not mention python. By now I am far from being a novice in python but do not claim deep experience or expertise either. In time, perh

Re: dangerous class neighborhood

2018-12-27 Thread Abdur-Rahmaan Janhangeer
btw what does A = . above means? the dot? Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: dangerous class neighborhood

2018-12-27 Thread Chris Angelico
On Fri, Dec 28, 2018 at 2:27 PM Avi Gross wrote: > > Sometimes when I post something I get back comments and evaluate them and > learn quite a bit. I then reply and debate every little point and it can > continue for a few rounds. > > I don't seem to be in that mood today so let me simply restate

RE: dangerous class neighborhood

2018-12-27 Thread Avi Gross
Sometimes when I post something I get back comments and evaluate them and learn quite a bit. I then reply and debate every little point and it can continue for a few rounds. I don't seem to be in that mood today so let me simply restate my entire post in a few sentences with no examples, no lectur

Re: Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-27 Thread Chris Angelico
On Fri, Dec 28, 2018 at 1:38 PM Daniel Ojalvo via Python-list wrote: > > Hello, > > I've been working on a python3 project and I came across an issue with the > open system call that, at the very least, isn't documented. In my humble > opinion, the > documentation

Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-27 Thread Daniel Ojalvo via Python-list
Hello, I've been working on a python3 project and I came across an issue with the open system call that, at the very least, isn't documented. In my humble opinion, the documentation should be updated because folks wouldn't expect open to be

Re: Ask for help about class variable scope (Re: Why doesn't a dictionary work in classes?)

2018-12-27 Thread Chris Angelico
On Fri, Dec 28, 2018 at 8:47 AM eryk sun wrote: > > On 12/27/18, Chris Angelico wrote: > > > > Class scope is special, and a generator expression within that class > > scope is special too. There have been proposals to make these kinds of > > things less special, but the most important thing to r

Re: dangerous class neighborhood

2018-12-27 Thread Chris Angelico
On Fri, Dec 28, 2018 at 8:47 AM Avi Gross wrote: > Question 2: Do you want the variables available at the class level or at the > instance level? For constants, definitely put them on the class. They'll be available on instances as well ("for free", if you like). For mutables, obviously you need

Re: Ask for help about class variable scope (Re: Why doesn't a dictionary work in classes?)

2018-12-27 Thread eryk sun
On 12/27/18, Chris Angelico wrote: > > Class scope is special, and a generator expression within that class > scope is special too. There have been proposals to make these kinds of > things less special, but the most important thing to remember is that > when you create a generator expression, it

dangerous class neighborhood

2018-12-27 Thread Avi Gross
There have been several discussions about unexpected behavior when people write programs within a class definition. Some suggest various ways around the problem and that is fine although I bet new people will keep encountering this issue. I have some questions about what people want to do with

Re: Ask for help about class variable scope (Re: Why doesn't a dictionary work in classes?)

2018-12-27 Thread Chris Angelico
On Fri, Dec 28, 2018 at 3:31 AM Ian Kelly wrote: > > On Wed, Dec 26, 2018 at 11:21 PM Chris Angelico wrote: > > > > On Thu, Dec 27, 2018 at 1:56 PM wrote: > > > > > > I saw the code below at stackoverflow. I have a little idea about the > > > scope of a class, and list comprehension and generat

Re: Ask for help about class variable scope (Re: Why doesn't a dictionary work in classes?)

2018-12-27 Thread Ian Kelly
On Wed, Dec 26, 2018 at 11:21 PM Chris Angelico wrote: > > On Thu, Dec 27, 2018 at 1:56 PM wrote: > > > > I saw the code below at stackoverflow. I have a little idea about the scope > > of a class, and list comprehension and generator expressions, but still > > can't figure out why Z4 works and

Facing an Error after migrating from python 3.4.1 to python 3.6.6 ( Failed to import the site module )

2018-12-27 Thread sandeep . bayi6
``` Error code: -- Traceback (most recent call last): File "C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\site.py", line 73,

Re: Getting Error after migrating from python 3.4.1 to python 3.6.6 ( Failed to import the site module )

2018-12-27 Thread sandeep . bayi6
On Thursday, December 27, 2018 at 7:49:16 PM UTC+5:30, sandee...@gmail.com wrote: > ``` > Error code: > -- > > > Traceback (most recent call last): >

Getting Error after migrating from python 3.4.1 to python 3.6.6 ( Failed to import the site module )

2018-12-27 Thread sandeep . bayi6
``` Error code: -- Traceback (most recent call last): File "C:\Users\sandeep\AppData\Local\Programs\Python\Python36-32\Lib\site.py", line 73, in

Re: Why do data descriptors (e.g. properties) take priority over instance attributes?

2018-12-27 Thread Peter J. Holzer
On 2018-12-17 21:57:22 +1100, Paul Baker wrote: > class C: > def __init__(self): > self.__dict__['a'] = 1 > > @property > def a(self): > return 2 > > o = C() > print(o.a) # Prints 2 What version of Python is this? I get a different res

Re: Why do data descriptors (e.g. properties) take priority over instance attributes?

2018-12-27 Thread Peter J. Holzer
On 2018-12-27 14:17:34 +0100, Peter J. Holzer wrote: > On 2018-12-17 21:57:22 +1100, Paul Baker wrote: > > class C: > > def __init__(self): > > self.__dict__['a'] = 1 > > > > @property > > def a(self): > > return 2 > > > > o = C() > > pr

next steps to make a python program more available

2018-12-27 Thread ant
ok, i have the program going and installable for my local Linux distribution. aka i have it packaged and on PyPI and it runs from my local terminal command line. i have people available for testing it out on Windows and a Mac, but i don't have any way of knowing what to do to make the program

Re: Ask for help about class variable scope (Re: Why doesn't a dictionary work in classes?)

2018-12-27 Thread eryk sun
On 12/27/18, jf...@ms4.hinet.net wrote: > > I still don't get it. When I change it to using list comprehension, the > problem is still there. (it now has no late-binding variable, right? :-) > class Too: > ... XS = [15, 15, 15, 15] > ... Z4 = [val for val in XS] > ... Z5 = [XS[0]

Re: Ask for help about class variable scope (Re: Why doesn't a dictionary work in classes?)

2018-12-27 Thread Terry Reedy
On 12/26/2018 9:53 PM, jf...@ms4.hinet.net wrote: I saw the code below at stackoverflow. I have a little idea about the scope of a class, and list comprehension and generator expressions, but still can't figure out why Z4 works and Z5 not. Can someone explain it? (in a not-too-complicated way:

Re: Ask for help about class variable scope (Re: Why doesn't a dictionary work in classes?)

2018-12-27 Thread jfong
eryk sun於 2018年12月27日星期四 UTC+8下午2時31分58秒寫道: > On 12/26/18, jf...@ms4.hinet.net wrote: > > I saw the code below at stackoverflow. I have a little idea about the scope > > of a class, and list comprehension and generator expressions, but still > > can't figure out why Z4 works and Z5 not. Can someon