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

2020-06-08 Thread zljubisic
Well the problem that I am facing with is, that I have to establish interface between python and outer system. Original question was about creation of input object (data that I have received from outer system). If I accept recommendation to use "from_" instead of "from", it could work, for proc

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

2020-06-06 Thread Terry Reedy
On 6/5/2020 6:59 PM, Ethan Furman wrote: 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, li

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: 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: 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