Fwd: property decorator?

2017-12-21 Thread Kirill Balunov
2017-12-21 2:56 GMT+03:00 Irv Kalb : > My questions about this are really historical. From my reading, it looks > like using an @property decorator is a reference to an older approach using > a built in "property" function. But here goes: > > 1) Why were these decorator names chosen? These two

Re: Problems with imports on multiple threads, with embedded Python

2017-12-21 Thread geoff . bache
On Thursday, 21 December 2017 00:33:54 UTC+1, Lawrence D’Oliveiro wrote: > On Thursday, December 21, 2017 at 5:13:33 AM UTC+13, geoff...@gmail.com wrote: > > > > I have a multithreaded application using an embedded Python 3.6.4 ... > > Avoid multithreading if you can. Is your application CPU-bou

Re: Python Learning

2017-12-21 Thread Larry Martell
On Mon, Dec 18, 2017 at 3:22 PM, Marko Rauhamaa wrote: > > Larry Martell : > > > On Mon, Dec 18, 2017 at 11:33 AM, Marko Rauhamaa wrote: > >> However, one great way to stand out is a portfolio of GitHub > >> projects. Several people have gotten an offer largely based on those > >> (after they ace

Regarding the error: TypeError: can’t pickle _thread.lock objects

2017-12-21 Thread Winston Manuel Vijay
Hi, It would be of immense help, if someone could provide a suitable solution or related information that helps to sort out the below stated issue- Ø I had installed the Python version 3.6.4 Ø Then I installed the package: Tensorflow Ø Installed g2p.exe by downloading from GitHub Ø T

Re: property decorator?

2017-12-21 Thread Cholo Lennon
On 20/12/17 21:39, Stefan Ram wrote: Irv Kalb writes: about property decorators. The code @property def salary(self): pass @salary.setter def salary(self, newSalary): pass is an abbreviation for def salary_get(self): pass salary = property( salary_get ) def salary_set(self, newSalary

Problem with assignment. Python error or mine?

2017-12-21 Thread rafaeltfreire
Dear community, I am having the following problem when I am assigning the elements of a vector below a certain number to zero or any other value. I am creating a new variable but Python edits the root variable. Why? import numpy as np X=np.arange(1, 1, 1) #root variable x1=X x1[x1<1]=0

Re: Problem with assignment. Python error or mine?

2017-12-21 Thread Neil Cerutti
On 2017-12-21, rafaeltfre...@gmail.com wrote: > Dear community, I am having the following problem when I am > assigning the elements of a vector below a certain number to > zero or any other value. I am creating a new variable but > Python edits the root variable. Why? > > import numpy as np > > X

Re: Problem with assignment. Python error or mine?

2017-12-21 Thread rafaeltfreire
Em quinta-feira, 21 de dezembro de 2017 16:21:57 UTC+1, Neil Cerutti escreveu: > On 2017-12-21, rafaeltfre...@gmail.com wrote: > > Dear community, I am having the following problem when I am > > assigning the elements of a vector below a certain number to > > zero or any other value. I am creatin

Re: Problem with assignment. Python error or mine?

2017-12-21 Thread MRAB
On 2017-12-21 15:05, rafaeltfre...@gmail.com wrote: Dear community, I am having the following problem when I am assigning the elements of a vector below a certain number to zero or any other value. I am creating a new variable but Python edits the root variable. Why? import numpy as np X=np.ar

Re: Problem with assignment. Python error or mine?

2017-12-21 Thread MarkA
On Thu, 21 Dec 2017 07:05:33 -0800, rafaeltfreire wrote: From docs.python.org: 8.10. copy — Shallow and deep copy operations Source code: Lib/copy.py Assignment statements in Python do not copy objects, they create bindings between a target and an object. For collections that are mutable or co

Re: Python Learning

2017-12-21 Thread Python
On Fri, Dec 15, 2017 at 04:51:09PM -0500, Bill wrote: > >I'm new to programming, can anyone guide me, how to start learning python > >programming language,...plz suggest some books also. > > > >Thanks all > > Are you sure you want to learn Python first? > Python does enough things "behind the sce

Re: Problem with assignment. Python error or mine?

2017-12-21 Thread John Ladasky
On Thursday, December 21, 2017 at 7:37:39 AM UTC-8, MRAB wrote: > Python never makes a copy unless you ask it to. > > What x1=X does is make the name x1 refer to the same object that X > refers to. No copying. Well, except with very simple, mutable data types like scalars... compare this: >>>

Re: Problem with assignment. Python error or mine?

2017-12-21 Thread Kirill Balunov
2017-12-21 22:06 GMT+03:00 John Ladasky : > On Thursday, December 21, 2017 at 7:37:39 AM UTC-8, MRAB wrote: > > > Python never makes a copy unless you ask it to. > > > > What x1=X does is make the name x1 refer to the same object that X > > refers to. No copying. > > Well, except with very simple,

Re: Problem with assignment. Python error or mine?

2017-12-21 Thread duncan smith
On 21/12/17 19:06, John Ladasky wrote: > On Thursday, December 21, 2017 at 7:37:39 AM UTC-8, MRAB wrote: > >> Python never makes a copy unless you ask it to. >> >> What x1=X does is make the name x1 refer to the same object that X >> refers to. No copying. > > Well, except with very simple, muta

Re: How to edit a function in an interactive python session?

2017-12-21 Thread Terry Reedy
On 12/20/2017 8:42 PM, Peng Yu wrote: R has the function edit() which allows the editing of the definition of a function. Does python have something similar so that users can edit python functions on the fly? Thanks. https://www.rdocumentation.org/packages/utils/versions/3.4.3/topics/edit In

Re: Regarding the error: TypeError: can’t pickle _thread.lock objects

2017-12-21 Thread Terry Reedy
On 12/21/2017 8:11 AM, Winston Manuel Vijay wrote: Hi, It would be of immense help, if someone could provide a suitable solution or related information that helps to sort out the below stated issue- Ø I had installed the Python version 3.6.4 Ø Then I installed the package: Tensorflow Ø

Re: What is wrong with this regex for matching emails?

2017-12-21 Thread Peter J. Holzer
On 2017-12-20 08:21:02 +1100, Chris Angelico wrote: > If there are no MX records for a domain, either the domain doesn't > exist, or it doesn't receive mail. This is not necessarily correct. An MTA has to fall back to A and records if no MX record exists, so a domain can receive mail without

Re: property decorator?

2017-12-21 Thread Irv Kalb
Thanks to Rob, Cameron, Ian, Chris and Kirill for the detailed explanations. Very helpful, Irv > On Dec 20, 2017, at 3:56 PM, Irv Kalb wrote: > > I am trying to work through the concept of the @property decorator with > respect to object oriented programming. > > I believe that I understand

Re: Python Learning

2017-12-21 Thread Rustom Mody
On Friday, December 22, 2017 at 12:12:58 AM UTC+5:30, Python wrote: > On Fri, Dec 15, 2017 at 04:51:09PM -0500, Bill wrote: > > >I'm new to programming, can anyone guide me, how to start learning python > > >programming language,...plz suggest some books also. > > > > > >Thanks all > > > > Are yo