Re: Can I have a class with property named "from"

2020-06-05 Thread DL Neil via Python-list
On 6/06/20 9:36 AM, zljubi...@gmail.com wrote: Hi, if I define class like this one: class abc: def __init__(self): self._from = None @property def from(self): return self._from @from.setter def from(self, value): self._from = value I get

Re: Strange use of Lambda arrow

2020-06-05 Thread Cameron Simpson
On 06Jun2020 02:48, MRAB wrote: On 2020-06-06 01:01, Chris Angelico wrote: On Sat, Jun 6, 2020 at 8:24 AM Cameron Simpson wrote: The OP may be being confused by JavaScript, where they have "arrow functions", which are what Python calls lambda: anonymous functions. It uses an arrow in the synt

Re: Strange use of Lambda arrow

2020-06-05 Thread MRAB
On 2020-06-06 01:01, Chris Angelico wrote: On Sat, Jun 6, 2020 at 8:24 AM Cameron Simpson wrote: The OP may be being confused by JavaScript, where they have "arrow functions", which are what Python calls lambda: anonymous functions. It uses an arrow in the syntax: (x,y) -> x+y In JS, th

Re: Strange use of Lambda arrow

2020-06-05 Thread Chris Angelico
On Sat, Jun 6, 2020 at 8:24 AM Cameron Simpson wrote: > The OP may be being confused by JavaScript, where they have "arrow > functions", which are what Python calls lambda: anonymous functions. It > uses an arrow in the syntax: > > (x,y) -> x+y > In JS, they're sometimes called "fat arrow" fu

Re: Can I have a class with property named "from"

2020-06-05 Thread Ethan Furman
On 06/05/2020 03:15 PM, MRAB wrote: On 2020-06-05 22:50, Ethan Furman wrote: There is no workaround that allows a keyword to be used except as a keyword, other than making it a string.  When faced with this kind of situation myself I use a synonym, like "since", or a translation, like "desde

Re: Strange use of Lambda arrow

2020-06-05 Thread Cameron Simpson
On 06Jun2020 02:40, Chris Angelico wrote: On Sat, Jun 6, 2020 at 2:36 AM Agnese Camellini wrote: Hello to everyone, lately i building up an open source project, with some collaborator, but one of them cannot contribute any more. He is a solution architect so he is very skilled (much more than

Re: Can I have a class with property named "from"

2020-06-05 Thread MRAB
On 2020-06-05 22:50, Ethan Furman wrote: On 06/05/2020 02:36 PM, zljubi...@gmail.com wrote: class abc: def __init__(self): self._from = None @property def from(self): return self._from @from.setter def from(self, value): self._from = value

Re: Can I have a class with property named "from"

2020-06-05 Thread Ethan Furman
On 06/05/2020 02:36 PM, zljubi...@gmail.com wrote: class abc: def __init__(self): self._from = None @property def from(self): return self._from @from.setter def from(self, value): self._from = value I get the error SyntaxError: invalid syn

Can I have a class with property named "from"

2020-06-05 Thread zljubisic
Hi, if I define class like this one: class abc: def __init__(self): self._from = None @property def from(self): return self._from @from.setter def from(self, value): self._from = value I get the error SyntaxError: invalid syntax because of the prop

Re: Can't download Pygame and Pgzero

2020-06-05 Thread Rhodri James
On 05/06/2020 11:54, Lily Sararat via Python-list wrote: I have trouble installing the Pygame and Pgzero on Window. I based on the instruction on the "Computer Coding Python Games for Kids" by Carol Vorderman. Nothing works. I tried Python 3.6.2 as describe in the book and the latest version

Re: Strange use of Lambda arrow

2020-06-05 Thread Chris Angelico
On Sat, Jun 6, 2020 at 2:36 AM Agnese Camellini wrote: > > Hello to everyone, lately i building up an open source project, with some > collaborator, but one of them cannot contribute any more. He is a solution > architect so he is very skilled (much more than me!). I am now analysing > his code to

Strange use of Lambda arrow

2020-06-05 Thread Agnese Camellini
Hello to everyone, lately i building up an open source project, with some collaborator, but one of them cannot contribute any more. He is a solution architect so he is very skilled (much more than me!). I am now analysing his code to finish the job but i don't get this use of the lambda arrow, it's

Re: Can't download Pygame and Pgzero

2020-06-05 Thread Lily Sararat via Python-list
To whom it may concern, I have trouble installing the Pygame and Pgzero on Window.  I based on the instruction on the "Computer Coding Python Games for Kids" by Carol Vorderman.  Nothing works.   I tried Python 3.6.2 as describe in the book and the latest version 3.8.3 still encounter on the

Re: Friday Finking: Imports, Namespaces, Poisoning, Readability

2020-06-05 Thread Rhodri James
AFAIKT the "three" are readability, naming conflicts and source location. On 05/06/2020 01:15, DL Neil via Python-list wrote: - how do you like to balance these three (and any other criteria)? Readability is king. Or queen, if you prefer. Anything that damages readability drops dramatically