Rahul Gupta wrote:
> consider the following code
> import csv
> import numpy as np
>
> with open("D:\PHD\obranking\\demo.csv", mode='r') as csv_file1,
> open("D:\PHD\obranking\\demo.csv", mode='r') as csv_file2:
> csv_reader1 = csv.DictReader(csv_file1)
> csv_reader2 = csv.DictReader(csv_
consider the following code
import csv
import numpy as np
with open("D:\PHD\obranking\\demo.csv", mode='r') as csv_file1,
open("D:\PHD\obranking\\demo.csv", mode='r') as csv_file2:
csv_reader1 = csv.DictReader(csv_file1)
csv_reader2 = csv.DictReader(csv_file2)
filename = "cell_split
On 2/05/20 12:00 PM, Bob van der Poel wrote:
I still think that the use of a keyword like "static" would be easiest.
def foo(arg):
static counter = 0
counter += 1
if counter ...
And in this case static just means that it's a variable only readable
inside foo() and it should maint
On 2/05/20 11:30 AM, Chris Angelico wrote:
On Sat, May 2, 2020 at 9:14 AM DL Neil via Python-list
wrote:
On 28/04/20 7:36 PM, Chris Angelico wrote:
"Best"? Not sure about that. Functions are first-class objects in
Python, so a function *is* a callable object. You don't have to create
a custom
I still think that the use of a keyword like "static" would be easiest.
def foo(arg):
static counter = 0
counter += 1
if counter ...
And in this case static just means that it's a variable only readable
inside foo() and it should maintain it's value between calls. A "global"
without t
On Sat, May 2, 2020 at 9:14 AM DL Neil via Python-list
wrote:
>
> On 28/04/20 7:36 PM, Chris Angelico wrote:
> >>> "Best"? Not sure about that. Functions are first-class objects in
> >>> Python, so a function *is* a callable object. You don't have to create
> >>> a custom class with a call method
On 28/04/20 7:36 PM, Chris Angelico wrote:
"Best"? Not sure about that. Functions are first-class objects in
Python, so a function *is* a callable object. You don't have to create
a custom class with a call method just to be able to attach attributes
to your function.
ChrisA
Using a mutable o
Given your replies, 'now' might be a good time to take a look at
Pytest, and see how you could use it to help build better code - by
building tested units/functions which are assembled into ever-larger
tested-units... (there is a range of choice/other testing aids if
Pytest doesn't take your fancy
Paul
Thanks! I'm glad there is theory about my concern. I knew
I wasn't the only one with that question.
cs
> > https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle
>
> Also:
>
> https://en.wikipedia.org/wiki/Expression_problem
--
https://mail.python.org/mailman/listinfo/python-lis