This more-anal-than-me program generated almost 2 warnings for every
line of code in my program. w t hey?
DFS comments
+-++ ---
|message id |occurrences
On 5/7/2016 1:01 PM, Chris Angelico wrote:
On Sun, May 8, 2016 at 2:51 AM, DFS wrote:
[1]
pylint says "Consider using enumerate instead of iterating with range and
len"
the offending code is:
for j in range(len(list1)):
do something with list1[j], list2[j], list3[j], etc.
enumera
On 5/7/2016 9:36 PM, Chris Angelico wrote:
On Sun, May 8, 2016 at 11:16 AM, DFS wrote:
On 5/7/2016 1:01 PM, Chris Angelico wrote:
The suggestion from a human would be to use zip(), or possibly to
change your data structures.
Happens like this:
address data is scraped from a website
On 5/7/2016 10:14 PM, Stephen Hansen wrote:
On Sat, May 7, 2016, at 06:16 PM, DFS wrote:
Why is it better to zip() them up and use:
for item1, item2, item3 in zip(list1, list2, list3):
do something with the items
than
for j in range(len(list1)):
do something with list1[j], list2[j
On 5/7/2016 3:40 PM, Terry Reedy wrote:
On 5/7/2016 12:51 PM, DFS wrote:
This more-anal-than-me program generated almost 2 warnings for every
line of code in my program. w t hey?
If you don't like it, why do you use it?
I've never used it before last night. I was shocked
On 5/7/2016 2:52 PM, Christopher Reimer wrote:
On 5/7/2016 9:51 AM, DFS wrote:
Has anyone ever in history gotten 10/10 from pylint for a non-trivial
program?
I routinely get 10/10 for my code. While pylint isn't perfect and
idiosyncratic at times, it's a useful tool to help
On 5/7/2016 11:25 PM, Steven D'Aprano wrote:
On Sun, 8 May 2016 02:51 am, DFS wrote:
This more-anal-than-me program generated almost 2 warnings for every
line of code in my program. w t hey?
DFS com
On 5/7/2016 11:51 PM, Chris Angelico wrote:
On Sun, May 8, 2016 at 1:28 PM, DFS wrote:
Invalid constant name "cityzip" (invalid-name)
Invalid constant name "state" (invalid-name)
Invalid constant name "miles" (invalid-name)
Invalid constant name "store"
On 5/7/2016 11:46 PM, Stephen Hansen wrote:
On Sat, May 7, 2016, at 08:04 PM, DFS wrote:
The lists I actually use are:
for j in range(len(nms)):
cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)"
vals = nms[j],street[j],city[j],state[j],zipcd[j]
The enumerated versio
On 5/8/2016 1:50 AM, Jussi Piitulainen wrote:
DFS writes:
The lists I actually use are:
for j in range(len(nms)):
cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)"
vals = nms[j],street[j],city[j],state[j],zipcd[j]
The enumerated version would be:
ziplists = zip(nms,s
On 5/8/2016 10:36 AM, Chris Angelico wrote:
On Mon, May 9, 2016 at 12:25 AM, DFS wrote:
for category,name,street,city,state,zipcode in ziplists:
try: db.execute(cSQL, vals)
except (pyodbc.Error) as programError:
if str(programError).find("UNIQUE constraint failed&
On 5/8/2016 11:51 AM, Steven D'Aprano wrote:
On Mon, 9 May 2016 12:25 am, DFS wrote:
for j in range(len(nms)):
cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)"
vals = nms[j],street[j],city[j],state[j],zipcd[j]
Why are you assigning cSQL to the same string over and
On 5/7/2016 2:43 PM, Peter Pearson wrote:
On Sat, 7 May 2016 12:51:00 -0400, DFS wrote:
This more-anal-than-me program generated almost 2 warnings for every
line of code in my program. w t hey?
Thank you for putting a sample of pylint output in front of my eyes;
you inspired me to install
On 5/8/2016 11:15 AM, Chris Angelico wrote:
On Mon, May 9, 2016 at 1:06 AM, DFS wrote:
On 5/8/2016 10:36 AM, Chris Angelico wrote:
On Mon, May 9, 2016 at 12:25 AM, DFS wrote:
for category,name,street,city,state,zipcode in ziplists:
try: db.execute(cSQL, vals)
except
On 5/8/2016 1:25 PM, Steven D'Aprano wrote:
On Sun, 8 May 2016 02:10 pm, DFS wrote:
+-++
|bad-whitespace |65 | mostly because I line up =
signs:
On 5/8/2016 7:36 AM, Steven D'Aprano wrote:
On Sun, 8 May 2016 11:16 am, DFS wrote:
address data is scraped from a website:
names = tree.xpath()
addr = tree.xpath()
Why are you scraping the data twice?
Because it exists in 2 different sections of the document.
names = tree.
On 5/8/2016 5:38 PM, Stephen Hansen wrote:
On Sun, May 8, 2016, at 02:16 PM, DFS wrote:
I was surprised to see the PEP8 guide approve of:
"Yes: if x == 4: print x, y; x, y = y, x"
https://www.python.org/dev/peps/pep-0008/#pet-peeves
That is not approving of that line of code as so
On 5/8/2016 6:05 PM, Stephen Hansen wrote:
On Sun, May 8, 2016, at 02:46 PM, DFS wrote:
On 5/8/2016 5:38 PM, Stephen Hansen wrote:
On Sun, May 8, 2016, at 02:16 PM, DFS wrote:
I was surprised to see the PEP8 guide approve of:
"Yes: if x == 4: print x, y; x, y = y, x"
https://www.
sSQL = "line 1\n"
sSQL += "line 2\n"
sSQL += "line 3"
--
https://mail.python.org/mailman/listinfo/python-list
On 5/8/2016 9:17 PM, Gregory Ewing wrote:
Stephen Hansen wrote:
The point is, you don't usually commit after an error happens. You
rollback.
He might want to commit the ones that *did* go in.
That's not necessarily wrong. It all depends on the
surrounding requirements and workflow.
Bingo.
python 2.7.11 docs: "The returned list is truncated in length to the
length of the shortest argument sequence."
a = ['who','let','the']
b = ['dogs','out?']
c = zip(a,b)
print c
[('who', 'dogs'), ('let', 'out?')]
Wouldn't it be better to return an empty element than silently kill your
data?
On 5/9/2016 3:53 AM, Steven D'Aprano wrote:
On Monday 09 May 2016 09:10, DFS wrote:
sSQL = "line 1\n"
sSQL += "line 2\n"
sSQL += "line 3"
Pointlessly provocative subject line edited.
huh? You call
"There should be one-- and preferably only one --obvious way to do it."
https://www.python.org/dev/peps/pep-0020/
---
sSQL = "line 1\n"
sSQL += "line 2\n"
sSQL += "line 3"
---
sSQL = ("line 1\n"
"line 2\n"
"line 3"
On 5/10/2016 2:13 AM, Cai Gengyang wrote:
Ok, so after reading YCombinator's RFS, I have decided that I want to
work on this :
---
EDUCATION
If we can fix education, we can eventua
On 5/10/2016 3:34 PM, Terry Reedy wrote:
On 5/10/2016 9:51 AM, Claudiu Popa wrote:
Thank you for letting us know. While pylint is indeed
opinionated in some cases, we're not trying to be
"arrogant", as you put it, towards Guido or the other core
developers. What's sad in this particular case is
On 5/10/2016 2:15 PM, Ian Kelly wrote:
On Tue, May 10, 2016 at 10:16 AM, DFS wrote:
On 5/9/2016 3:53 AM, Steven D'Aprano wrote:
On Monday 09 May 2016 09:10, DFS wrote:
sSQL = "line 1\n"
sSQL += "line 2\n"
sSQL += "line 3"
Pointlessly provocative
On 5/7/2016 10:50 PM, Chris Angelico wrote:
On Sun, May 8, 2016 at 12:15 PM, DFS wrote:
The only reason
for j in range(len(list1)):
do something with list1[j], list2[j], list3[j], etc.
or
for item1, item2, item3 in zip(list1, list2, list3):
do something with the items
works is
101 - 127 of 127 matches
Mail list logo