Hi folks,
I have the following loop (actually repeated many times )
def locChoices(self):
locDS = self.eslocation.getDataSet()
loc_Choices=['']
locKeys=[0]
for row in locDS:
loc_Choices.append(row['facility'])
locKeys.append(row['pkid'])
johnf wrote:
> Hi folks,
>
>
> I have the following loop (actually repeated many times )
If you have repetetive code look into ways to parameterize it, like
def choices(rows, choices_column, keys_column):
...
>
> def locChoices(self):
> locDS = self.eslocation.getDataSet()
> loc_Choice
On 6/24/19 10:15 AM, johnf wrote:
.
>
> Since I use a lot of similar loops to populate many dropdown controls I
> started investigating the use of list comprehensions. But I can't
> figure out how to use them in this loop and wonder if it will improve
> the performance.
To amplify a tiny bit on
I am little experimenting with Python type annotation today. I wrote a simple
class as below:
>>> from datetime import date
>>> class Person:
... dob: date
... def __init__(self, dob):
... self.dob = dob
...
>>> Person(11)
<__main__.Person object at 0x10e078128>
>>> p = Perso
On 6/24/19 12:48 PM, Arup Rakshit wrote:
> I am little experimenting with Python type annotation today. I wrote a simple
> class as below:
>
from datetime import date
class Person:
> ... dob: date
> ... def __init__(self, dob):
> ... self.dob = dob
> ...
Person
Actually I do not see a reply from Peter?? I don't have a clue what
was said.
I realize that performance is not a big issue in this case - of course
an increase in speed is always welcome. I was more interested in a
better understanding of the list comprehensions. Since I have so many
Hi John,
On 25/06/19 4:15 AM, johnf wrote:
Hi folks,
I have the following loop (actually repeated many times )
def locChoices(self):
locDS = self.eslocation.getDataSet()
loc_Choices=['']
locKeys=[0]
for row in locDS:
loc_Choices.append(row['facil
Thank you - it worked! I'm glad you are no longer sleepy!
Actually I wanted the naming to remain consistent with the other loops
So the name of the function/method (it is in a class) caused the use of
the underscore
locChoices == location choices
def locChoices(self) cause me to use loc_Cho
On 6/24/19 4:24 PM, johnf wrote:
> Thank you - it worked! I'm glad you are no longer sleepy!
>
> Actually I wanted the naming to remain consistent with the other loops
>
> So the name of the function/method (it is in a class) caused the use of
> the underscore
>
> locChoices == location choices