Re: pylint woes

2016-05-07 Thread Jussi Piitulainen
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,street,city,state,zipcd) > for

[issue26974] Crash in Decimal.from_float

2016-05-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Following example causes a segmentation fault. from decimal import Decimal class BadFloat(float): def as_integer_ratio(self): return 1 def __abs__(self): return self Decimal.from_float(BadFloat(1.2)) -- components:

Re: pylint woes

2016-05-07 Thread Ian Kelly
On Sat, May 7, 2016 at 9:28 PM, DFS wrote: > But I think there are some pylint bugs here: > - > > standard import "import pyodbc, sqlite3" comes before "import pyodbc, > sqlite3" (wrong-import-order) > > *

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 2:40 PM, DFS wrote: >>> It says "Used builtin function 'filter'. Using a list comprehension can >>> be >>> clearer. (bad-builtin)" >> >> >> Kill that message and keep using filter. > > > > Unfortunately, 'bad-builtin' caught 2 truly bad uses of built-ins

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-05-07 Thread Martin Panter
Martin Panter added the comment: ''' call find_library("foo") libc: libc.a libc.a: libc.a libc.so.6: libc.a libcrypto.so: libcrypto.a ''' The above don’t seem right to me, unless compiling with “cc -llibc.so.6” etc works on AIX. ''' call cdll.LoadLibrary("foo") m: libm.so: ''' These

Re: pylint woes

2016-05-07 Thread DFS
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" (invalid-name) Invalid

[issue22636] avoid using a shell in ctypes.util: replace os.popen with subprocess

2016-05-07 Thread Martin Panter
Martin Panter added the comment: There are a few review comments that probably need addressing. -- stage: patch review -> needs patch ___ Python tracker

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 2:10 PM, DFS wrote: >>> +-++ >>> |trailing-whitespace |59 | heh! >>> +-++ >>> |multiple-statements |23 | do this to save lines. >>>

[issue26973] Dict View binops permit non-set types

2016-05-07 Thread Joshua Morton
New submission from Joshua Morton: Following the comments in python ideas [1], I'm submitting a bug report. In python 3, dictionary views (KeysView and ItemsView specifically) do not adhere to the same interface as Sets. Specifically, the __and__, __or__, __xor__, and __sub__ methods on Views

Re: pylint woes

2016-05-07 Thread DFS
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 comments +-++

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 1:38 PM, DFS wrote: >> This code is reeking with bad habits to be broken. Assigning a throwaway >> variable to walk the index is unnecessary when Python can do it for you >> behind the scenes. > > > Don't you think python also allocates a throwaway variable

Re: pylint woes

2016-05-07 Thread Stephen Hansen
On Sat, May 7, 2016, at 08:28 PM, DFS wrote: > >> +-++ > >> |superfluous-parens |3 | I like to surround 'or' > >> statments with parens > > > > I would need examples to comment > > > if ("Please choose a

Re: pylint woes

2016-05-07 Thread Chris Angelico
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" (invalid-name) > Invalid variable name "rs" (invalid-name) ...

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Jim Dodgen
Great help. My Python program is a rewrite of a Perl program I wrote. An interesting exercise. The reason being it is targeted for a Raspberry Pi and for the Pi Python has the most support. *Jim Dodgen* On Sat, May 7, 2016 at 6:38 PM, Ben Finney wrote: >

Re: pylint woes

2016-05-07 Thread Stephen Hansen
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 version would be: > > ziplists =

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Random832
On Sat, May 7, 2016, at 22:43, Steven D'Aprano wrote: > > If not for the quotas, a citizen of some other country would have an > > equal chance to get a green card as a citizen of India or China. > > If you have a big hat with 5,000,000 tickets marked "Indian", and 500 > tickets marked "Finish",

Re: pylint woes

2016-05-07 Thread DFS
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 break bad

Re: pylint woes

2016-05-07 Thread DFS
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 at what it

Re: pylint woes

2016-05-07 Thread Steven D'Aprano
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 comments > +-++ --- >

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/7/2016 6:40 PM, Terry Reedy wrote: On 5/7/2016 3:17 PM, Christopher Reimer wrote: For my purposes, I'm using the list comprehension over filter to keep pylint happy. How sad. The pylint developers arrogantly take it on themselves to revise Python, against the wishes of Guido and the

[issue11063] uuid.py module import has heavy side effects

2016-05-07 Thread Martin Panter
Martin Panter added the comment: The versioning problem with libFOO.so.N already occurs with compiled programs. A C program compiled against libuuid.so.1 will fail to load if you only have libuuid.so.2. On the other hand, a Python program using find_library() will find either version. My

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 12:43 PM, Steven D'Aprano wrote: > On Sun, 8 May 2016 04:40 am, Random832 wrote: > >> On Sat, May 7, 2016, at 11:16, Steven D'Aprano wrote: >>> > Indian and Chinese H1B holders are getting screwed, which is of course >>> > the whole objective of the

[issue23275] Can assign [] = (), but not () = []

2016-05-07 Thread Martin Panter
Martin Panter added the comment: Erm, I think you went overboard with the sequence → iterable changes and subscripting; see the review. Also, I think target_list should be made optional in the grammar description. -- ___ Python tracker

Re: pylint woes

2016-05-07 Thread DFS
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],

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Steven D'Aprano
On Sun, 8 May 2016 07:35 am, Stephen Hansen wrote: > I'd read over PEP8 (the document, not the tool) and > apply style guide recommendations thoughtfully, not mechanically. Guido is not a fan of automated PEP8 checkers. He agrees entirely with your comment: apply style guides thoughtfully, not

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 12:15 PM, DFS wrote: > On 5/7/2016 9:36 PM, Chris Angelico wrote: >> >> On Sun, May 8, 2016 at 11:16 AM, DFS wrote: >>> >>> street = [s.split(',')[0] for s in addr] >>> city = [c.split(',')[1].strip() for c in addr] >>> state =

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Steven D'Aprano
On Sun, 8 May 2016 04:40 am, Random832 wrote: > On Sat, May 7, 2016, at 11:16, Steven D'Aprano wrote: >> > Indian and Chinese H1B holders are getting screwed, which is of course >> > the whole objective of the country limits. >> >> The *whole* objective? You don't think that *part* of the

Re: pylint woes

2016-05-07 Thread MRAB
On 2016-05-08 03:14, 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],

Re: pylint woes

2016-05-07 Thread DFS
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

Re: pylint woes

2016-05-07 Thread Stephen Hansen
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], list3[j], etc. Although

Re: pylint woes

2016-05-07 Thread Terry Reedy
On 5/7/2016 3:52 PM, Ray Cote wrote: Biggest issue I have with pyLint is that it complains when function parameters are indented twice vs. once. pyFlakes likes the twice. Example: def function_name( parm_1, long_parm_name, …. end_of_long_list_of params)

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Terry Reedy
On 5/7/2016 3:17 PM, Christopher Reimer wrote: For my purposes, I'm using the list comprehension over filter to keep pylint happy. How sad. The pylint developers arrogantly take it on themselves to revise Python, against the wishes of Guido and the other core developers, and you and feel

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Ben Finney
Chris Angelico writes: > On Sun, May 8, 2016 at 9:54 AM, Jim Dodgen wrote: > > The empty token is needed but useless, it is arg[0] most people just > > repeat the program name > > Far from useless. It's how a process learns its own name, and yes, > repeating

Re: pylint woes

2016-05-07 Thread Chris Angelico
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: > > names =

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Ben Finney
Jim Dodgen writes: > I'm have problems redirecting stdout and stderr to /dev/null in a > program that does a fork and exec. You may be interested in the ‘python-daemon’ library . It takes care of all the fiddly bits to turn your

Re: pylint woes

2016-05-07 Thread DFS
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.

[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-07 Thread Ilya Kulakov
Ilya Kulakov added the comment: Guido, Probably a legitimate example of having multiple event loops in a single thread: you want to run certain coroutine synchronously without running thread's own event loop. -- ___ Python tracker

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Jim Dodgen
Thanks Chris I now have things working using a version 3.4.3 it finds subprocess.DEVNULL just fine *Jim Dodgen* On Sat, May 7, 2016 at 5:10 PM, Chris Angelico wrote: > On Sun, May 8, 2016 at 9:54 AM, Jim Dodgen wrote: > > The empty token is needed but

[issue23815] Segmentation fault when create _tkinter objects

2016-05-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: I noticed that you reported the crash and asked for a fix or reversion on #15721 6 months ago, with no response. Hence, lets not wait longer. Looking again, I see that there were 3 rounds of patches in 2012/2013. If you want to follow up, I suggest closing

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 9:54 AM, Jim Dodgen wrote: > The empty token is needed but useless, it is arg[0] most people just repeat > the program name Far from useless. It's how a process learns its own name, and yes, repeating the image name is the most common way to provide that.

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Jim Dodgen
*Thanks for the help* On Sat, May 7, 2016 at 12:16 PM, Martin A. Brown wrote: > > Hello there, > > >I'm new to python but well versed on other languages such as C and > >Perl > > > >I'm have problems redirecting stdout and stderr to /dev/null in a > >program that does a

[issue18730] suffix parameter in NamedTemporaryFile silently fails when not prepending with a period

2016-05-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Correct. The doc I quoted was for the unlying mkstemp function. I should have said so even though this fact was easily discovered. So by docstring, I meant the one for mkstemp also, which is currently 27 lines. The docstring for the high level functions

[issue23640] int.from_bytes() is broken for subclasses

2016-05-07 Thread Ethan Furman
Changes by Ethan Furman : -- Removed message: http://bugs.python.org/msg237891 ___ Python tracker ___

[issue23640] int.from_bytes() is broken for subclasses

2016-05-07 Thread Ethan Furman
Changes by Ethan Furman : -- Removed message: http://bugs.python.org/msg240053 ___ Python tracker ___

[issue23640] int.from_bytes() is broken for subclasses

2016-05-07 Thread Ethan Furman
Changes by Ethan Furman : -- Removed message: http://bugs.python.org/msg239619 ___ Python tracker ___

[issue23640] int.from_bytes() is broken for subclasses

2016-05-07 Thread Ethan Furman
Ethan Furman added the comment: Not sure what I was thinking at the time, but several of my comments were supportive of `classmethod`s not calling subclass' __new__; I actually do not think that, and am +1 on the patch. -- nosy: +ethan.furman ___

[issue14111] IDLE Debugger should handle interrupts

2016-05-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: More info: Even though the debug window looks inactive, it is not. After the restart, debugger cannot be turned off because it is 'active'. It must be stuck on the raise statement. The window can be closed, but after that, it cannot be brought back because

[issue23815] Segmentation fault when create _tkinter objects

2016-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I called the fix a workaround because other solution may be to make PyType_FromSpec() not setting tp_new in such cases. I expect that this is common mistake when convert a static class to a heap class with PyType_FromSpec(). At least we should add warnings

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/7/2016 1:31 PM, Marko Rauhamaa wrote: Christopher Reimer : Never know when an asshat hiring manager would reject my resume out of hand because my code fell short with pylint. Remember that it's not only the company checking you out but also you checking the

[issue26949] IDLE restarts when one debugs code raising SystemExit

2016-05-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: #14111 is about handling ^C while debugging. So for now I will assume that handling 'raise KeyboardInterrupt' is part of that issue. -- ___ Python tracker

[issue14111] IDLE Debugger should handle interrupts

2016-05-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: 'raise KeyboardInterrupt' in code causes shell to hang until Restart Shell Cntl-F6 in invoked. >>> [DEBUG ON] >>> raise KeyboardInterrupt === RESTART: Shell === [DEBUG ON] >>> The behavior was noted

[issue26935] android: test_os fails

2016-05-07 Thread Martin Panter
Martin Panter added the comment: I think this is an Android bug. See specification , fix . If the change is to go into Python,

[issue18730] suffix parameter in NamedTemporaryFile silently fails when not prepending with a period

2016-05-07 Thread Martin Panter
Martin Panter added the comment: I think Terry may have had the mkstemp() doc string in mind. The NamedTemporaryFile() doc string already points to that function, and it doesn’t make sense to single NamedTemporaryFile() out above other functions. -- nosy: +martin.panter

[issue23815] Segmentation fault when create _tkinter objects

2016-05-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: The news part of the patch did not apply -- best not to include such in posted patches. After recompiliing 3.5 on Windows 10, the two tkinter test cases give the 3.3 TypeErrors instead of crashing. test_tcl also runs. curses does not run on Windows. I do

[issue26949] IDLE restarts when one debugs code raising SystemExit

2016-05-07 Thread ppperry
ppperry added the comment: This issue has worse consequences than I previously thought. It also affects `KeyboardInterrupt` with worse consequences. If you run a program raising `KeyboardInterrupt` in the debugger, the shell will hang. Restarting the shell fixes this problem. --

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Radek Holý
2016-05-07 21:17 GMT+02:00 Christopher Reimer : > On 5/5/2016 6:37 PM, Stephen Hansen wrote: > >> On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: >> >>> Which is one is correct (Pythonic)? Or does it matter? >>> >> First, pylint is somewhat opinionated,

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/7/2016 2:22 PM, Chris Angelico wrote: On Sun, May 8, 2016 at 5:17 AM, Christopher Reimer wrote: Since the code I'm working on is resume fodder (i.e., "Yes, I code in Python! Check out my chess engine code on GitHub!"), I want it to be as Pythonic and

[issue24500] provide context manager to redirect C output

2016-05-07 Thread Martin Panter
Martin Panter added the comment: Is it really common to have a C wrapper with undesirable output? I suspect there is not much demand for this feature. Maybe this would be better outside of Python’s standard library. -- nosy: +martin.panter status: open -> languishing

Re: python, ctypes and GetIconInfo issue

2016-05-07 Thread mymyxin
Hello eryk sun, thank you very much for your help and detailed answers. With the provided links and useful information I should be able to get a better understanding how ctypes works internally. Thank you Hubert -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 4:42 AM, Michael Selik wrote: > >> +-++ >> |line-too-long|5 | meh >> > > Yeah, I think 80 characters can be somewhat tight. Still, 5 long lines in > 200ish lines of code? Sounds like you

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 7:35 AM, Stephen Hansen wrote: > On Sat, May 7, 2016, at 12:17 PM, Christopher Reimer wrote: >> On 5/5/2016 6:37 PM, Stephen Hansen wrote: >> > On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: >> >> Which is one is correct (Pythonic)? Or does it

Re: python - handling HTTP requests asynchronously

2016-05-07 Thread lordluke80
Il giorno sabato 7 maggio 2016 21:04:47 UTC+2, Michael Selik ha scritto: > On Fri, May 6, 2016 at 3:01 AM wrote: > > > The PDF is generated through an external API. Since currently is generated > > on demand, this is handled synchronously via an HTTP request/response. > >

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Stephen Hansen
On Sat, May 7, 2016, at 12:17 PM, Christopher Reimer wrote: > On 5/5/2016 6:37 PM, Stephen Hansen wrote: > > On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: > >> Which is one is correct (Pythonic)? Or does it matter? > > First, pylint is somewhat opinionated, and its default options

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Nathan Hilterbrand
On 05/07/2016 05:22 PM, Chris Angelico wrote: On Sun, May 8, 2016 at 5:17 AM, Christopher Reimer wrote: pylint. Never know when an asshat hiring manager would reject my resume out of hand because my code fell short with pylint. I see that as a good

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Chris Angelico
On Sun, May 8, 2016 at 5:17 AM, Christopher Reimer wrote: > On 5/5/2016 6:37 PM, Stephen Hansen wrote: >> >> On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: >>> >>> Which is one is correct (Pythonic)? Or does it matter? >> >> First, pylint is somewhat

[issue23815] Segmentation fault when create _tkinter objects

2016-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is special exception -- tp_new is not inherited for static types whose base class is 'object' (see a comment in inherit_special() in Objects/typeobject.c#4569 for explanation). After converting them to heap types they became inherit tp_new from

[issue26924] android: test_concurrent_futures fails

2016-05-07 Thread Berker Peksag
Berker Peksag added the comment: Thanks! Perhaps we should not set HAVE_SEM_* to 1 if we are on Android in the configure step. -- ___ Python tracker ___

Re: python chess engines

2016-05-07 Thread Christopher Reimer
On 5/3/2016 10:13 PM, DFS wrote: Wanted to start a new thread, rather than use the 'motivated' thread. Can you play your game at the console? Nope. Only displays the board on the console. An early version had the forward movement for pawns implemented. The way I think about a chess engine

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Marko Rauhamaa
Christopher Reimer : > Never know when an asshat hiring manager would reject my resume out of > hand because my code fell short with pylint. Remember that it's not only the company checking you out but also you checking the company out. Would you want to work for

[issue26924] android: test_concurrent_futures fails

2016-05-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: sem_open() is not implemented as well. Here is a gdb session with a breakpoint set at semlock_new() (SEM_FAILED is NULL on android): Breakpoint 1, semlock_new (type=0xb6d070c0 <_PyMp_SemLockType>, args=(1, 1, 1, '/mp-dkzrq4ed', True), kwds=0x0) at

Re: pylint woes

2016-05-07 Thread Christopher Reimer
On 5/7/2016 12:52 PM, Ray Cote wrote: I’m impressed with 10/10. My approach is to ensure flake8 (a combination of pyflakes and pep8 checking) does not report any warnings and then run pyLint as a final check. I just installed pyflakes and ran it against my 10/10 files. It's not complaining

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/5/2016 6:37 PM, Stephen Hansen wrote: On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: Which is one is correct (Pythonic)? Or does it matter? First, pylint is somewhat opinionated, and its default options shouldn't be taken as gospel. There's no correct: filter is fine. Since

Re: pylint woes

2016-05-07 Thread Ray Cote
On Sat, May 7, 2016 at 2:52 PM, Christopher Reimer < christopher_rei...@icloud.com> 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 >

[issue26924] android: test_concurrent_futures fails

2016-05-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: There is a typo in sem_unlink_alt.diff, not in the patch itself but in the neighbouring lines. In Modules/_multiprocessing/semaphore.c, it should be, I think, after one does 's/define sem_unlink(name)/define SEM_UNLINK(name)/': @@ -194,8 +194,8 @@ # define

Re: pylint woes

2016-05-07 Thread Christopher Reimer
On 5/7/2016 12:23 PM, Stephen Hansen wrote: On Sat, May 7, 2016, at 11:52 AM, Christopher Reimer wrote: You can do better. You should strive for 10/10 whenever possible, figure out why you fall short and ask for help on the parts that don't make sense. I think this is giving far too much

Re: pylint woes

2016-05-07 Thread Terry Reedy
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 suppose the answer is that it did find a few things to check. You might be happier with pychecker, which is

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Christopher Reimer
On 5/5/2016 7:57 PM, Stephen Hansen wrote: On Thu, May 5, 2016, at 07:46 PM, Dan Sommers wrote: On Thu, 05 May 2016 18:37:11 -0700, Stephen Hansen wrote: ''.join(x for x in string if x.isupper()) The difference is, both filter and your list comprehension *build a list* which is not

Re: How to see html code under the particular web page element?

2016-05-07 Thread zljubisic
> There's probably some Angular JS code involved with this. Look at the > source (not the page source, the source code in the developer's > tools). Is it possible to get that code using python? -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-07 Thread Stephen Hansen
On Sat, May 7, 2016, at 11:52 AM, Christopher Reimer wrote: > You can do better. You should strive for 10/10 whenever possible, > figure out why you fall short and ask for help on the parts that don't > make sense. I think this is giving far too much weight to pylint's opinion on what is

Re: redirecting stdout and stderr to /dev/null

2016-05-07 Thread Martin A. Brown
Hello there, >I'm new to python but well versed on other languages such as C and >Perl > >I'm have problems redirecting stdout and stderr to /dev/null in a >program that does a fork and exec. T found this method googling >around and it is quite elegant compared to to the Perl version. > >So

Re: pylint woes

2016-05-07 Thread Stephen Hansen
Pylint is very opinionated. Feel free to adjust its configuration to suit your opinions of style. In particular, several of these might be related to PEP8 style issues. On Sat, May 7, 2016, at 09:51 AM, DFS wrote: >DFS comments >

[issue26924] android: test_concurrent_futures fails

2016-05-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: Attached the results with sem_unlink_alt.diff. -- Added file: http://bugs.python.org/file42774/sem_unlink_alt_output.txt ___ Python tracker

[issue6827] deepcopy erroneously doesn't call __setstate__ if __getstate__ returns empty dict

2016-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The documentation of the pickle module doesn't match PEP 307 and the implementation. The copy module was changed in issue25718 to match the implementation of the pickle module. This fixed this issue. -- nosy: +serhiy.storchaka

Re: python - handling HTTP requests asynchronously

2016-05-07 Thread Michael Selik
On Fri, May 6, 2016 at 3:01 AM wrote: > The PDF is generated through an external API. Since currently is generated > on demand, this is handled synchronously via an HTTP request/response. Are you sending the request or are you receiving the request? If you are sending,

[issue16113] Add SHA-3 and SHAKE (Keccak) support

2016-05-07 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'd there any good reason 2.7 needs this? They are available via pypi as extensions. (Read: I vote no) On Sat, May 7, 2016, 3:15 AM Larry Hastings wrote: > > Larry Hastings added the comment: > > Christian: any interest in proposing

[issue12290] __setstate__ is called for false values

2016-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually this wording is not quite correct. __setstate__() is called for any pickled state. It is not called only if the state is not pickled. The state is not pickled if reducing method (__reduce_ex__ or __reduce__) doesn't return state or returns None as

Re: pylint woes

2016-05-07 Thread Christopher Reimer
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 break bad programming habits. Since I came from a Java

Re: pylint woes

2016-05-07 Thread Peter Pearson
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 pylint and try it out. If

redirecting stdout and stderr to /dev/null

2016-05-07 Thread Jim Dodgen
I'm new to python but well versed on other languages such as C and Perl I'm have problems redirecting stdout and stderr to /dev/null in a program that does a fork and exec. T found this method googling around and it is quite elegant compared to to the Perl version. So to isolate things I made a

Re: pylint woes

2016-05-07 Thread Michael Selik
On Sat, May 7, 2016 at 12:56 PM DFS wrote: > |mixed-indentation|186 | I always use tab > Don't mix tabs and spaces. I suggest selecting all lines and using your editor to convert spaces to tabs. Usually there's a feature to "tabify". >

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Random832
On Sat, May 7, 2016, at 11:16, Steven D'Aprano wrote: > > Indian and Chinese H1B holders are getting screwed, which is of course > > the whole objective of the country limits. > > The *whole* objective? You don't think that *part* of the objective may > be > to ensure that citizens of countries

[issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows

2016-05-07 Thread Tim Peters
Tim Peters added the comment: Just noting that the `multiprocessing` module can be used instead. In the example, add import multiprocessing as mp and change with concurrent.futures.ProcessPoolExecutor() as executor: to with mp.Pool() as executor: That's all it takes.

[issue26924] android: test_concurrent_futures fails

2016-05-07 Thread Berker Peksag
Berker Peksag added the comment: Xavier, could you try this alternative patch? -- Added file: http://bugs.python.org/file42773/sem_unlink_alt.diff ___ Python tracker

[issue26924] android: test_concurrent_futures fails

2016-05-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset eee959fee5f5 by Berker Peksag in branch 'default': Issue #26924: Fix Windows buildbots https://hg.python.org/cpython/rev/eee959fee5f5 -- ___ Python tracker

[issue26924] android: test_concurrent_futures fails

2016-05-07 Thread Berker Peksag
Berker Peksag added the comment: Thanks, Xavier. -- components: +Extension Modules -Cross-Build, Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue22893] Idle: __future__ does not work in startup code.

2016-05-07 Thread Eric Fahlgren
Changes by Eric Fahlgren : -- nosy: +eric.fahlgren ___ Python tracker ___ ___

[issue26924] android: test_concurrent_futures fails

2016-05-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1030aa8357a7 by Berker Peksag in branch 'default': Issue #26924: Do not define _multiprocessing.sem_unlink under Android https://hg.python.org/cpython/rev/1030aa8357a7 -- nosy: +python-dev ___ Python

[issue26906] format(object.__reduce__) fails intermittently

2016-05-07 Thread Antti Haapala
Antti Haapala added the comment: Could it be possible to to make the debug build absolutely abort on any usage of PyType's that are not readied, usage including instantiating them. Then, instead of changing all `static` linkages to `extern`s (as in Serhiy's first patch) one could rather make

Re: pylint woes

2016-05-07 Thread Chris Angelico
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. > > enumeration would be: > for

[issue26924] android: test_concurrent_futures fails

2016-05-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: > Here is the result of the test: I meant, results with the new patch. -- ___ Python tracker ___

  1   2   >