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

2016-05-10 Thread Martin Panter

Martin Panter added the comment:

Patches: I’m not sure, but maybe it would help the Reitveld review system if 
the src/ directory in them was eliminated (e.g. src/Python-3.5.1 vs just 
Python-3.5.1). Also, if you are using Gnu diff, maybe you can try the -N 
(--new-file) option to include aixutil.py in the diff, and -x (--exclude) 
__pycache__ to avoid that directory.

Personally, I would find patches a lot easier to handle than a tar file, 
especially if I cannot figure out which bits of the tar file are original code 
and which are changed code.

It seems you want to CDLL() to accept names using the Linux/BSD libFOO.so.N 
convention, but load an AIX library with a related name. This sounds like a bad 
design to me, for multiple reasons. I would like to hear other people’s 
opinions before going in that direction.

This is my understanding of the CDLL() calls currently needed to load the Open 
SSL library on various platforms:

openssl 1.0.2.g-3 package on Arch Linux: CDLL("libcrypto.so.1.0.0")
Windows: CDLL("libeay32.dll")
OS X (Darwin): CDLL("libcrypto.1.0.0.dylib")
FreeBSD: CDLL("libcrypto.so.8")
AIX: CDLL("libcrypto.a(libcrypto.so.1.0.0)", DEFAULT_MODE | RTLD_MEMBER)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Intel Distribution for Python

2016-05-10 Thread Chris Angelico
On Wed, May 11, 2016 at 1:17 PM, Arshpreet Singh  wrote:
> Thanks for the information, I just applied for program but I got one mail 
> about license and expiration.
>
> 
> This software license expires on October 29, 2016.
> 
>
> I am not able to understand that can anyone put some light on that how 
> license can be expired?

If I own something (say, a skillet that can fry your breakfast and
then clonk an intruder on the head), I can permit you to use it under
any terms I like. That includes putting a time limit on it ("you can
use it now, but I'll need it when I go to look at the floating
lights"). It's the same with software. The license terms are "Until
20161029, you may use this as long as blah blah blah, but after
20161029, you may not use this under any circumstances". A copyright
owner is free to put any restrictions on the use of the program; if
that prevents it from being useful to you, you're free to ignore the
program altogether.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Intel Distribution for Python

2016-05-10 Thread Terry Reedy

On 5/10/2016 11:12 PM, Chris Angelico wrote:

On Wed, May 11, 2016 at 12:00 PM, beliavsky--- via Python-list
 wrote:

The Intel Distribution for Python 2017 Beta 
https://software.intel.com/en-us/python-distribution is available for Windows, 
Linux, and Mac OS for Python 2.7 and 3.5.

"The Beta product adds new Python packages like scikit-learn, mpi4py, numba, conda, 
tbb (Python interfaces to Intel® Threading Building Blocks) and pyDAAL (Python interfaces 
to Intel® Data Analytics Acceleration Library). The Beta also delivers performance 
improvements for NumPy/SciPy through linking with performance libraries like Intel® MKL, 
Intel® Message Passing Interface (Intel® MPI), Intel® TBB and Intel® DAAL."

I just installed Intel Python today. Has anyone tried it? Does it run your 
programs faster than the usual CPython?



I haven't used it, but based on a reading of their blurbs, I suspect
you won't see any significant improvement in base Python code - the
advantage is the numeric computation work.


All their benchmarks are heavy numeric computation.


For general Python performance, check out PyPy, although it tends to
lag behind CPython in versions somewhat. However, PyPy doesn't do
anything for your numpy performance, and doesn't even guarantee that
everything works:

http://pypy.org/download.html#installing-numpy

So if the Intel Math Kernel Library lives up to the descriptions, it
might be the thing to fill in this gap - "use PyPy to speed up your
Python code, or Intel Python to speed up your numpy code". (Most
programs won't have performance issues on both of those at once.)

It's worth noting that Intel engineers have been proposing a number of
performance improvements for backporting into the CPython core, and
some of them even made it into 2.7. I've no idea whether the page you
linked to is part of the same project or not; it might be completely
separate, or it might be the source of all those improvements.


I presume it is all related.  What I find interesting is that Intel 
thinks it will be more profitable to be involved in numerical 
computation driven by python than not to.




--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


[issue26993] Copy idlelib *.py files with new names

2016-05-10 Thread Nick Coghlan

Nick Coghlan added the comment:

Terry, have you considered also doing a top level idlelib -> _idlelib rename in 
addition to the file level name changes?

My rationale for suggesting that:

1. The idle2 vs idle3 distinction will be clear at a glance (as they'll be in 
different directories)
2. The package level rename handles bifurcation of files that aren't themselves 
being renamed
3. You can subsequently iterate on the internal APIs without worrying about 
third party breakage
4. You set the stage for eventually moving IDLE to being an independently 
versioned implicitly pip-installed component (perhaps with an 
"ensure_default_ide" module akin to "ensurepip")

In relation to that last point, while I think it's important for CPython to 
come with a default IDE, I *don't* think it's important for the Python standard 
library to provide a default IDE-building toolkit (and, indeed, Linux distros 
tend to separate out not only IDLE, but also Tcl/Tk support in general, from 
the default Python installation).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Intel Distribution for Python

2016-05-10 Thread Arshpreet Singh
Thanks for the information, I just applied for program but I got one mail about 
license and expiration. 


This software license expires on October 29, 2016.


I am not able to understand that can anyone put some light on that how license 
can be expired? 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Intel Distribution for Python

2016-05-10 Thread Chris Angelico
On Wed, May 11, 2016 at 12:00 PM, beliavsky--- via Python-list
 wrote:
> The Intel Distribution for Python 2017 Beta 
> https://software.intel.com/en-us/python-distribution is available for 
> Windows, Linux, and Mac OS for Python 2.7 and 3.5.
>
> "The Beta product adds new Python packages like scikit-learn, mpi4py, numba, 
> conda, tbb (Python interfaces to Intel® Threading Building Blocks) and pyDAAL 
> (Python interfaces to Intel® Data Analytics Acceleration Library). The Beta 
> also delivers performance improvements for NumPy/SciPy through linking with 
> performance libraries like Intel® MKL, Intel® Message Passing Interface 
> (Intel® MPI), Intel® TBB and Intel® DAAL."
>
> I just installed Intel Python today. Has anyone tried it? Does it run your 
> programs faster than the usual CPython?
>

I haven't used it, but based on a reading of their blurbs, I suspect
you won't see any significant improvement in base Python code - the
advantage is the numeric computation work.

For general Python performance, check out PyPy, although it tends to
lag behind CPython in versions somewhat. However, PyPy doesn't do
anything for your numpy performance, and doesn't even guarantee that
everything works:

http://pypy.org/download.html#installing-numpy

So if the Intel Math Kernel Library lives up to the descriptions, it
might be the thing to fill in this gap - "use PyPy to speed up your
Python code, or Intel Python to speed up your numpy code". (Most
programs won't have performance issues on both of those at once.)

It's worth noting that Intel engineers have been proposing a number of
performance improvements for backporting into the CPython core, and
some of them even made it into 2.7. I've no idea whether the page you
linked to is part of the same project or not; it might be completely
separate, or it might be the source of all those improvements.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26977] Unnecessary line in statistics.pvariance

2016-05-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 87130512ef34 by Steven D'Aprano in branch '3.5':
NEWS message for issue #26977.
https://hg.python.org/cpython/rev/87130512ef34

New changeset 39faad3cd626 by Steven D'Aprano in branch 'default':
Merge NEWS update from 3.5 for issue #26977.
https://hg.python.org/cpython/rev/39faad3cd626

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26996] Add secrets module as per PEP 506.

2016-05-10 Thread Steven D'Aprano

Changes by Steven D'Aprano :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26996] Add secrets module as per PEP 506.

2016-05-10 Thread Steven D'Aprano

New submission from Steven D'Aprano:

(This is already done, but I should have added a ticket before committing the 
new module.)

See PEP-0506.

--
assignee: steven.daprano
components: Library (Lib)
messages: 265288
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: Add secrets module as per PEP 506.
type: enhancement
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Paul Rubin
DFS  writes:
> But, I am dead serious about becoming a good Python developer, and I
> truly appreciate all clp replies.

People are more likely to reply to you if your posting style makes you
enjoyable instead of annoying to engage with.  That's community spirit.
Friendly participation is always welcomed even when the person is new or
otherwise not highly knowledgeable.

Failing that, if you're a knowledgeable enough developer that people
learn things from your posts even at moments when your style is
annoying, they might interact with you for the self-interested sake of
benefiting from access to your knowledge.  There are some regulars here
whose stuff is always worth reading even though they can be prickly at
times.

If you don't bring worthwhile amounts of knowledge AND your posting
style is annoying, there's a considerable incentive to not bother
reading your stuff at all.  That will tend to decrease the amount of
replies you receive.

Hope this helps!
-- 
https://mail.python.org/mailman/listinfo/python-list


Intel Distribution for Python

2016-05-10 Thread beliavsky--- via Python-list
The Intel Distribution for Python 2017 Beta 
https://software.intel.com/en-us/python-distribution is available for Windows, 
Linux, and Mac OS for Python 2.7 and 3.5.

"The Beta product adds new Python packages like scikit-learn, mpi4py, numba, 
conda, tbb (Python interfaces to Intel® Threading Building Blocks) and pyDAAL 
(Python interfaces to Intel® Data Analytics Acceleration Library). The Beta 
also delivers performance improvements for NumPy/SciPy through linking with 
performance libraries like Intel® MKL, Intel® Message Passing Interface (Intel® 
MPI), Intel® TBB and Intel® DAAL."

I just installed Intel Python today. Has anyone tried it? Does it run your 
programs faster than the usual CPython?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26977] Unnecessary line in statistics.pvariance

2016-05-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6f27dbc55f10 by Steven D'Aprano in branch '3.5':
Issue 26977, remove unneeded line in pvariance (duplicate call to _ss).
https://hg.python.org/cpython/rev/6f27dbc55f10

New changeset 3c75707045f5 by Steven D'Aprano in branch 'default':
Branch merge for issue 26977
https://hg.python.org/cpython/rev/3c75707045f5

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24194] tokenize yield an ERRORTOKEN if an identifier uses Other_ID_Start or Other_ID_Continue

2016-05-10 Thread Meador Inge

Meador Inge added the comment:

Attached is a first cut patch for this.  (CC'd haypo as a unicode expert).

--
assignee:  -> meador.inge
keywords: +patch
nosy: +haypo, meador.inge
stage: needs patch -> patch review
Added file: http://bugs.python.org/file42808/issue24194-v0.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Chris Angelico
On Wed, May 11, 2016 at 10:16 AM, Thomas 'PointedEars' Lahn
 wrote:
>>> With the “%” string operator (deprecated),
>>
>> according to who?
>
> TFM.

[citation needed]

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Thomas 'PointedEars' Lahn
DFS wrote:

> On 5/8/2016 8:44 PM, Thomas 'PointedEars' Lahn wrote:
>> DFS wrote:
>>> sSQL =  "line 1\n"
>>> sSQL += "line 2\n"
>>> sSQL += "line 3"
>>
>> […]
>> #---
>> sSQL = ("line 1\n"
>> "line 2\n"
>> "line 3")
>> #---
>>
>> […]
> 
> or
> 
> sSQL = "line 1\n" \
>   "line 2\n" \
>   "line 3"
> 

Parentheses are less error-prone.

>> With the “%” string operator (deprecated),
> 
> according to who?

TFM.

>> Next time, RTFM first:
> 
> 
> Ironically, PointyHead, […]
>
>> Internet is the thing with cables; Usenet is the thing with people.  I
>> for one tend to avoid communicating with few-letter entities; exceptions
>> to that would probably include only E.T., M.J., ALF, and K.I.T.T.
> 
> How about FU?

*PLONK*

(Note to moderators: But you have let *this* through, huh?)

.
.
.
.
.
.
.
.
.
.
.
.
.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
-- 
https://mail.python.org/mailman/listinfo/python-list


Moderation [was Re: ...What's wrong with this concatenation statement?]

2016-05-10 Thread Steven D'Aprano
On Wed, 11 May 2016 10:16 am, Thomas 'PointedEars' Lahn wrote:

> (Note to moderators: But you have let *this* through, huh?)


Moderation only affects the mailing list python-list@python.org, the Usenet
mirror remains unmoderated. If you are reading this via Usenet, you may see
DFS's insults, but it doesn't appear here:

https://mail.python.org/pipermail/python-list/2016-May/thread.html


-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pylint woes

2016-05-10 Thread MRAB

On 2016-05-10 23:36, DFS wrote:
[snip]


If lists are still being created:

* at every moment in time, len(list1) returns a length that doesn't
change even if data is added to the list after the call to len().

Example: If the list has 100 items in it at the point len(list) is called:

for i in range(len(list1))

will never iterate more than 100x, no matter how large list1 grows to.

Caveat: since list1 may be bigger or smaller than the other lists at
that moment in time, an error may occur when using list2[i], list3[i].


Is that all correct as you understand it?


Yes.



* at every moment in time, zip(list1, list2, etc) will return a fixed,
same-length lists of tuples, which doesn't change even if data is added
to any of the lists after the call to zip().

Example: if the lists have 100, 97 and 102 items in them at the point
zip(lists) is called:

for item1, item2, item3 in zip(list1, list2, list3)

will never iterate beyond 97x, even if the lists grow while the
enumeration is occurring.

Caveat: since zip() possibly truncates lists, the results - the usage of
the data - could be completely invalid.


Is that all correct as you understand it?

In Python 2, zip iterates through the arguments immediately and returns 
a list of tuples, so the answer is yes.


In Python 3, zip returns a lazy iterator (like itertools.izip in Python 
2) that gets the values from the arguments _on demand_, so the answer is no.


[snip]

--
https://mail.python.org/mailman/listinfo/python-list


Re: String concatenation (was: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?)

2016-05-10 Thread sohcahtoa82
On Sunday, May 8, 2016 at 5:44:25 PM UTC-7, Thomas 'PointedEars' Lahn wrote:
> Also, it would be a good idea if you posted under your real name.  Internet 
> is the thing with cables; Usenet is the thing with people.  I for one tend 
> to avoid communicating with few-letter entities; exceptions to that would 
> probably include only E.T., M.J., ALF, and K.I.T.T.
> 
> -- 
> PointedEars
> 
> Twitter: @PointedEars2
> Please do not cc me. / Bitte keine Kopien per E-Mail.

I don't blame people for not wanting to use their real name on the Internet, 
especially if you're a woman.  There are a lot of crazy people out there that 
will find out where you live and send death threats just because you disagree 
with them or you happen to be a woman that enjoys video games or exists in the 
tech world.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python - handling HTTP requests asynchronously

2016-05-10 Thread Michael Selik
On Sat, May 7, 2016 at 4:46 PM  wrote:

> 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.
> >
> >
> > Are you sending the request or are you receiving the request?
> > If you are sending, you can just use threads as you are only doing IO.
> > If you are receiving the requests and generating PDFs, you may want to
> use
> > subprocesses if the PDF-generation is compute-intensive.
> >
> >
> > > 3) multiprocessing module, with e.g. 10 as workers limit.
> > >
> >
> > multiprocessing.Pool is an easy way to use subprocesses
> > multiprocessing.pool.ThreadPool is an easy way to use threads. It's not
> > well documented, but has the exact same interface as Pool.
> >
> > the goal is to use the API concurrently (e.g. send 10 or 100 http
> requests
> > > simultaneously, depending on how many concurrent requests the API can
> > > handle).
> > >
> >
> > Sounds like you want to use threads. How does the API let you know you're
> > hitting it too frequently? Perhaps you want to code an exponential
> backoff
> > and retry wrapper for your API requests.
>
> Thanks for the reply.
> Currently the django view that does the job does three http request:
> - the first does a POST and send the payload used during the PDF
> rendering, the response contains a url to check the pdf generation progress;
> - the second loop over that url, checking the progress of pdf generation.
> Once the response contains the keyword 'status': 'complete', then it give
> also a url for the file retrieval;
> - the third one is a GET to retrieve the file, the reponse contains the
> binary content of the file, then this content is read and wrapped as
> attachment of a django http response, and then returned to the user.
>
> the goal is to reuse the existing code as much as possible, possibly doing
> concurrently, and saving the file instead on a folder.
>

I'm not a Django expert. Does the Django View require all that stuff to
happen before Django can send an HTTP Response back to the user? If so, I
suggest you respond to the user immediately: "now generating a bunch of
PDFs..." and take care of the rest in the background. Perhaps just write to
a file, database, or message queue the info for the PDFs to generate. Have
a separate program periodically read the file, database, or message queue
to do that work and then maybe email the user when it's completed.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What should a decorator do if an attribute already exists?

2016-05-10 Thread Michael Selik
On Tue, May 10, 2016 at 11:48 AM Peter Otten <__pete...@web.de> wrote:

> Steven D'Aprano wrote:
> > I have a decorator that adds an attribute to the decorated function:
> >inner.instrument = instrument
> >return inner
>


> the original instrument is still accessible as f.__wrapped__.instrument


I'd say Peter's example is Option 6:
Wrap the instrumented function with a second instrumented wrapper.

Since you have various kinds of instruments, silently adding another layer
makes sense to me. Is it OK if the order matters? Will some of the
instruments get confused because they're working on a wrapper instead of
the original function?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Ethan Furman

On 05/10/2016 02:21 PM, DFS wrote:

[some inflammatory nonsense]

and is now being moderated.  If you see flame-bait in one of the 
unmoderated venues please ignore it.


Thanks.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Re: pylint woes

2016-05-10 Thread DFS

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 because each list has the same number of items.


Sure, but who cares what each item's position is? All that matters is
that they have corresponding positions, which is what zip() does.


They have corresponding positions because zip() possibly truncates data!




Imagine you don't even have the whole lists yet. Imagine someone's
still writing stuff to them as you work. Maybe they're infinite in
length. You can't iterate up to the length of list1, because it
doesn't HAVE a length. But you can still zip it up with other parallel
collections, and iterate over them all.


Disregarding a list of infinite length.


If lists are still being created:

* at every moment in time, len(list1) returns a length that doesn't 
change even if data is added to the list after the call to len().


Example: If the list has 100 items in it at the point len(list) is called:

for i in range(len(list1))

will never iterate more than 100x, no matter how large list1 grows to.

Caveat: since list1 may be bigger or smaller than the other lists at 
that moment in time, an error may occur when using list2[i], list3[i].



Is that all correct as you understand it?



* at every moment in time, zip(list1, list2, etc) will return a fixed, 
same-length lists of tuples, which doesn't change even if data is added 
to any of the lists after the call to zip().


Example: if the lists have 100, 97 and 102 items in them at the point 
zip(lists) is called:


for item1, item2, item3 in zip(list1, list2, list3)

will never iterate beyond 97x, even if the lists grow while the 
enumeration is occurring.


Caveat: since zip() possibly truncates lists, the results - the usage of 
the data - could be completely invalid.



Is that all correct as you understand it?


So, if that's all correct, it doesn't matter whether you use 'for i in 
range(len(lists))' or 'for item in zip(lists)': neither will guarantee 
data integrity.  I haven't timed them, but as I see it, neither has a 
definite advantage over the other.


So what I decided to do was build the lists, check that the lengths are 
all the same (exit the program if not), zip() them, and use enumeration 
because it looks less a little less clunky.  I see no advantage beyond 
appearance.



--
https://mail.python.org/mailman/listinfo/python-list


[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-05-10 Thread Demur Rumed

Demur Rumed added the comment:

I've been waiting on storchaka to finish code reviewing peephole based on his 
statement of 'Reviewing peephole.c still is not completed.' before uploading a 
patch which addresses the issues raised since

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26994] unexpected behavior for booleans in argparse

2016-05-10 Thread R. David Murray

R. David Murray added the comment:

Yes, it is an unitended consequence of the fact that argparse types are 
arbitrary single argument functions (that take an arbitrary string as the 
argument and convert it), and bool is a single argument function.  
Unfortunately we're stuck with it now.  The correct answer, of course, is to 
write your own bool type converter if you need one.

It is possible there should be a documentation mention that bool is not 
approprate as a type function, since int and float, for example, are explicitly 
mentioned.  If you want to submit a patch to that end I'll reopen the issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: The irony

2016-05-10 Thread sohcahtoa82
On Tuesday, May 10, 2016 at 11:03:47 AM UTC-7, DFS wrote:
> "There should be one-- and preferably only one --obvious way to do it."
> 
> https://www.python.org/dev/peps/pep-0020/
> 
> 

Each method of string concatenation has different uses.

> ---
> sSQL =  "line 1\n"
> sSQL += "line 2\n"
> sSQL += "line 3"

This method is simple, easy to read, and is fine for cases where you're not 
going to be concatenating more than a couple strings *AT RUN-TIME*.


> ---
> sSQL = ("line 1\n"
>  "line 2\n"
>  "line 3")

This performs implicit string concatenation *AT COMPILE TIME*.  It doesn't work 
if the strings you are putting together are variables.

> ---
> sSQL = "\n".join([
>   "line 1",
>   "line 2",
>   "line 3",
> ])

This joins several strings (at run time) with a string separating them.  Though 
an empty string, comma, or a new line are the most common strings to use, you 
can use any string.

> ---
> sSQL =  """line 1
> line 2
> line 3"""
> ---
> sSQL = """\
> line 1
> line 2
> line 3"""

These two are effectively the same, sure.  I'll give you that.

> ---
> sSQL = "line 1\n" \
> "line 2\n" \
> "line 3"

This is just implicit string concatenation and no real different than your 
second option except you used the explicit line continuation character instead 
of using the implicit line continuation created by using parentheses.

> ---
> 
> 
> Which is the "one obvious way" to do it?
> I liked:
> 
> sSQL =  "line 1\n"
> sSQL += "line 2\n"
> sSQL += "line 3"
> 
> 
> but it's frowned upon in PEP8.

It's frowned upon because it is incredibly slow when used a lot.  Every time 
you do a += on a string, it has to re-allocate memory, whereas other methods 
either figure it out at compile time or figure out how much memory will be 
needed and allocate it once.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue21099] Switch applicable importlib tests to use PEP 451 API

2016-05-10 Thread Brett Cannon

Brett Cannon added the comment:

I'll try to get to it today or tomorrow.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21099] Switch applicable importlib tests to use PEP 451 API

2016-05-10 Thread Eric Snow

Eric Snow added the comment:

Could I get a quick review on this.  There shouldn't be anything surprising or 
controversial here.  I'm pretty confident about the patch and it's pretty 
low-impact so if I don't hear back in the next day or two I'll merge it.

Note: the posted patch does not apply cleanly but the difference is cosmetic.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Ethan Furman

On 05/10/2016 02:21 PM, DFS wrote:

On 5/9/2016 3:53 AM, Steven D'Aprano wrote:



Pointlessly provocative subject line edited.



huh?  You called yourself a "master crafts/wo/man".



Challenging someone's boastful claim isn't trolling.



My expectation was to not be met by smug, sanctimonious and
condescending replies from the likes of DuhPricko.



'master craftswoman' my ass...



Take your net-nannying somewhere else.  It's not welcome /anywhere/.


Having found and read D'Aprano's post I can assure you that:

- he wasn't claiming to be a master craftsman
- he wasn't being arrogant

I can also assure you that *you* are being hostile, rude, and 
discriminatory, and such behaviour is not welcome here.


Any further posts of this nature and you will be placed on moderation.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2016-05-10 Thread Michael Felt

Michael Felt added the comment:

In https://bugs.python.org/issue26439 I have been working on this for AIX - as 
the default behavior was to depend on two things:
a) ldconfig -p (which generally does not exist on AIX, and I doubt it will know 
about the non-gnu libraries
b) that the objects are files rather than members of an archive

For python cdll() to work (as find_library generally did not) - the work-around 
was to extract archive members into standard directories and/or hard-code 
unique AIX names. But again, always as files, as CDLL did not modify the 
dlopen() mode to permit loading a shared library from an archive.

re: this issue and behavioral differences between find_library and cdll() 
(rather dlopen()) searches - a linker is different from a dlopen. When 
compiling an argument such as -lc -- on AIX -- tells the linker to look in 
libc.a for any member (of the right size) that satisfies an unknown symbol. 
That archive (base) and member (member) name is remembered in the "loader 
section" during linking. Note that static members have no loader section of 
their own, nor do they add one to the object (program or shared library) being 
linked.
As a compatibility feature - when a member is not found in an archive the AIX 
rtl (run-time-linker) also looks for a file named libFOO.so (e.g., libc.so) - 
this grace behavior is why CDLL() has worked somewhat using default behavior in 
Lib/ctypes.

As to LD_LIBRARY_PATH and LIBPATH. In AIX terms, these are environment 
variables to supplement the library search path - only when no PATH information 
is provided (i.e., cdll("./libc.so") will only look in the current directory of 
the process, and only for the file libc.so)
The default search path is a list of the directories used to link the 
executable (e.g., python). For me that list is: 
***Import File Strings***
INDEX  PATH  BASEMEMBER
0  /usr/vac/lib:/usr/lib:/lib

In other words, python, by default, is only going to look in very standard 
locations - even though it knows it's prefix is not /usr.

There are two solutions - and I will make changes as appropriate.
a) automate setting an environment variable if it is not already set to 
something like 
 _os.environ['LIBPATH'] = "%s/lib" % _sys.prefix
and not something "arbitrary" such as /usr/local/lib
b) modify the LDFLAGS when packaging to include
-L${prefix}/lib which will have the effect of changing the default search path 
via -W,-blibpath=/usr/vac/lib:/usr/lib:/lib:${prefix}/lib


In any case, in my patch for AIX in ctypes the two will work identical (cdll() 
even calls aix.find_library() to simplify portability between GNU/posix 
environments that expect or support only filenames to work with AIX archive 
packaging.

My apologies for the wall of text. This is not a simple subject.

--
nosy: +Michael.Felt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19711] add test for changed portions after reloading a namespace package

2016-05-10 Thread Eric Snow

Eric Snow added the comment:

I've gone ahead and pushed the patch.

--
resolution:  -> fixed
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19711] add test for changed portions after reloading a namespace package

2016-05-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c22ec7a45114 by Eric Snow in branch 'default':
Fixes #19711: Add tests for reloading namespace packages.
https://hg.python.org/cpython/rev/c22ec7a45114

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Chris Angelico
On Wed, May 11, 2016 at 7:21 AM, DFS  wrote:
> Take your net-nannying somewhere else.  It's not welcome /anywhere/.

DFS, you are out of line. Please reconsider the *way* you are saying
things, and especially, don't call people names.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2016-05-10 Thread aixtools

aixtools added the comment:

On 5/8/2016 8:29 AM, Martin Panter wrote:
> Martin Panter added the comment:
>
> Your new patch calls find_library() internally in CDLL(); why?
Because arguments that work for GNU (aka Linux, even though internally 
it is called "posix") will not work for AIX.
> My understanding is CDLL() is a fairly lightweight wrapper around the 
> dlopen() call.
For AIX, the dlopen() call is a front-end for the function 
initAndLoad(). I have not looked in depth at Module/_ctypes (only 
recently found it) and I do not know how much work is being done there 
for the different platforms.
> On Linux, you either pass a full library file name, or an SO-name.
Same for AIX: a full-path library name, relative-path library name, or a 
library name and the library search path (with optional additional 
directories provided via environment variables (LIBPATH or 
LD_LIBRARY_PATH - when it is a FILE, or an archive(member_name) (with 
archive part being full or relative, or stem) and RTLD_MEMBER ORed into 
the mode argument.
> Both these strings can be discovered for compiled objects using e.g.:
Likewise for AIX: - example: an executable - notice how many are named 
shr.o: how is cdll("shr.o") suppossed to know it is libc, or is it libcrypt?

root@x064:[/usr/lib]ldd /usr/sbin/sshd
/usr/sbin/sshd needs:
  /usr/lib/libc.a(shr.o)
  /usr/lib/libcrypto.a(libcrypto.so.1.0.0)
  /usr/lib/libz.a(libz.so.1)
  /usr/lib/libpam.a(shr.o)
  /usr/lib/libdl.a(shr.o)
  /unix
  /usr/lib/libcrypt.a(shr.o)
  /usr/lib/libpthreads.a(shr_xpg5.o)
  /usr/lib/libpthreads.a(shr_comm.o)

Or a file:
./perl-5.14.4/lib/5.14.4/aix-thread-multi-64int/auto/B/B.so needs:
  /usr/lib/libpthreads.a(shr_xpg5.o)
  /usr/lib/libc.a(shr.o)
  /unix
  /usr/lib/libpthreads.a(shr_comm.o)
  /usr/lib/libcrypt.a(shr.o)

Again, cdll("shr.o") is not going to find the correct archive.
> $ ldd build/lib.linux-x86_64-2.7-pydebug/_ssl.so
>   linux-vdso.so.1 (0x7fff567fe000)
>   libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x7f598474c000)
>   libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x7f59842d4000)
>   . . .
>
> So in Python, the SO-name or full path can be used, but not the compile-time 
> name, unless you first pass it through find_library():

 CDLL("libcrypto.so.1.0.0")  # soname
> 
 CDLL("/usr/lib/libcrypto.so.1.0.0")  # Full path
> 
 CDLL("crypto")  # Compile-time name
> Traceback (most recent call last):
>File "", line 1, in 
>File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
>  self._handle = _dlopen(self._name, mode)
> OSError: crypto: cannot open shared object file: No such file or directory
 find_library("crypto")  # Some people pass the result of this to CDLL()
> 'libcrypto.so.1.0.0'
Thank you for the explanation of what should be used when. Maybe I 
worked too hard for the current result: (note - 64-bit this time! and 
new member names, even for libc.so)

michael@x071:[/usr/lib]python -m ctypes.util
None
libc.a(shr_64.o)
None
aix.find_library("libiconv.so") libiconv.a(shr4_64.o)
aix.find_library("libintl.so") libintl.a(libintl.so.1)
aix.find_library("libintl.so.1") libintl.a(libintl.so.1)
aix.find_library("libintl.so.2") None :: should be None!
aix.find_library("libintl.so.8") None



libcrypt.a(shr_64.o)

Back to Why though.

Ease of use, and portability with existing convention. My experience 
with just two python packages I wanted to port is that cdll("libFOO.so") 
is what is used, and works on GNU. I wanted that to work ASIS. I also 
noticed that sometimes code was explicit about the version (sometimes 
the latest was not right, and the code complained). So, since "short" 
names are preferred, and are portable - those are what programmers tend 
to use. Full-path-names imply an assumption.

dlopen() is not going to know that libc.so is actually libc.a(shr.o) - 
so I call find_library() for portability aka Ease of Use. While it may 
be slightly less performance I am hoping (assuming) cdll("foo") is not 
the most central part of any application - and the overhead is acceptable.

And thanks for the question. It is simple enough to remove now, should 
it be considered a sin.

> --
>
> ___
> Python tracker 
> 
> ___

--
nosy: +aixto...@gmail.com

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread DFS

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 subject line edited.




huh?  You called yourself a "master crafts/wo/man".


Stop trolling.



Challenging someone's boastful claim isn't trolling.




--
DFS: "python is awesome, but too many options for doing the same thing also
makes it difficult.  For me, anyway."

DuhPricko: "That's the difference between a master and an apprentice. The
apprentice likes to follow fixed steps the same way each time. The master
craftsman knows her tools backwards, and can choose the right tool for the
job, and when the choice of tool really doesn't matter and you can use
whatever happens to be the closest to hand."
--


So what, you're upset by the implication that you haven't already
mastered Python when you apparently just started a couple months ago?
Temper your expectations.



Of course that wasn't my expectation.  That would be crazy...

My expectation was to not be met by smug, sanctimonious and 
condescending replies from the likes of DuhPricko.





'master craftswoman' my ass...


Take your gender insults somewhere else. They're not welcome here.


Take your net-nannying somewhere else.  It's not welcome /anywhere/.


--
https://mail.python.org/mailman/listinfo/python-list


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

2016-05-10 Thread Yury Selivanov

Yury Selivanov added the comment:

> If I understood it correctly, get_event_loop() would never return "default" 
> event loop (in terms of current implementation) for a running task, because 
> it always be overridden with "running" event loop. If it's so, are you sure 
> it won't raise any problems with backward compatibility?

I think this is extremely unlikely.  I hope that there is not much code out 
there that relies on this behaviour.  But you have a point.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Ilya Kulakov

Ilya Kulakov added the comment:

Yury, 

> `get_event_loop()` will then try to use the `running_loop` object first, and 
> if nothing is there, fall back to its current implementation.

Do you think hiding "default" event loop completly from a currently executing 
coroutine is safe?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Ilya Kulakov

Ilya Kulakov added the comment:

Yury,

> Not sure I understand the question.

If I understood it correctly, get_event_loop() would never return "default" 
event loop (in terms of current implementation) for a running task, because it 
always be overridden with "running" event loop. If it's so, are you sure it 
won't raise any problems with backward compatibility?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Yury Selivanov

Yury Selivanov added the comment:

> Do you think hiding "default" event loop completly from a currently executing 
> coroutine is safe?

Not sure I understand the question.  Anyways, let's see what Guido thinks about 
this all.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread DFS

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 that the
feedback had to come in rather a harsh manner, on this group,
instead of being reported as a bug or an enhancement on pylint's
bug tracker.


My impression is that the objection to 'bad builtin' was communicated
somehow to someone involved with PyLint  at least a year ago and ignored
or outright rejected.  But I don't remember details.  I might be
mistaken or have been given false information.


Anyway, I wanted to tell you that I agree with your opinion
regarding that message and as such, it is removed and won't be
emitted anymore in the next release (1.6)


Then my harsh comment re pylint is not currently valid.  Thank you.

Hiring managers misusing the score to evaluate applicants is a different
issue.


Interesting.

Got any horror stories to share?




--
https://mail.python.org/mailman/listinfo/python-list


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

2016-05-10 Thread Yury Selivanov

Yury Selivanov added the comment:

>> I now think that we don't need a new function for getting the currently 
>> running event loop.

> May I ask you to elaborate on this?

In my last message I propose to modify 'get_event_loop' to return the running 
loop reliably.  To me this is to me the most important thing -- this will make 
things like Task.current more reliable.

Adding another function (get_running_loop) won't change much. It would have a 
slightly different behaviour, but likely it won't be used anywhere in asyncio, 
or other libraries.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Ilya Kulakov

Ilya Kulakov added the comment:

Yury,

> I now think that we don't need a new function for getting the currently 
> running event loop.

May I ask you to elaborate on this? Asynchronous API I'm aware of (including  
other languages) typically allows to get "main" (which in asyncio is lazily 
created for main thread only), and "current". Sometimes there is also a 
convenient "global" which can be used when you want to do some async work 
outside. E.g. take a look at public API of Apple's Grand Central Dispatch, 
specifically `dispatch_get_current_queue`.

Even Python's thread module allows to get "current_thread" instead of passing 
it into run callback and requiring a user to carry it around by hand.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Chris Angelico
On Wed, May 11, 2016 at 1:35 AM,   wrote:
> Basically, pylint overwhelms the user
> right now with its enabled checks and we're trying to split these
> into tiers, as seen in the following:
>
> $ pylint myproject
> # core checkers enabled
> 10/10 - Congrats, you're clean on a core. You might try with "--pedantic" 
> now.
>
> $ pylint myproject --pedantic
> # pedantic checkers enabled.
> 10/10 - Congrats, you're clean on pedantic. You might try with 
> --refactoring now
>
> $ pylint myproject --refactoring
> # refactoring checkers enabled
> 10/10 - Congrats, you're clean on refactoring. Last up, try with --style 
> now.
>
> $ pylint myproject --style
> 10/10 - Now you're pylint clean.
>
> Or running them all:
>
> $ pylint myproject --all

Definitely support this notion. Not sure the "on a core" part makes
sense, but that's a minor triviality.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2016-05-10 Thread Ilya Kulakov

Ilya Kulakov added the comment:

> TBH, I don't fully understand Ilya's case with threads, synchronous 
> coroutines, possible deadlocks etc.

I feel sorry for sharing that example. It didn't help and made my points 
regarding original issue unclear, hidden behind example's complexity.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Yury Selivanov

Yury Selivanov added the comment:

> Yury, what do you think of this yourself? Maybe you can explain it better
than Ilya?

TBH, I don't fully understand Ilya's case with threads, synchronous coroutines, 
possible deadlocks etc.  So I'll just explain what I would want out of this.

I don't like a few aspects of the current design of 'get_event_loop'.  Mainly 
because it creates an event loop implicitly, or it can just fail with a 
RuntimeError under some conditions.  When one has a few event loops, implicitly 
called 'get_event_loop' from Future and other asyncio functions won't work 
correctly.  IMO, this is something that we at least should try to fix (even 
though it's not an idiomatic use case for asyncio).

I now think that we don't need a new function for getting the currently running 
event loop.  Instead we can try to improve the `get_event_loop()` function a 
little.

The core idea is to add a thread-local object `running_loop`, which will point 
to the currently running event loop in the current thread.  And `Loop._run` 
method will set/reset a reference to the loop to `running_loop`.

`get_event_loop()` will then try to use the `running_loop` object first, and if 
nothing is there, fall back to its current implementation.

Now, this is a point where everything becomes complicated. To quote 
myself,--"Yes, the patch part is easy",--I don't think it is that easy anymore 
;)

Currently, event loops are decoupled from policies.  This means that we can't 
make loops to use some hidden shared thread-local object (`running_loop`) that 
policies and loops will work with.  There has to be another new public policy 
APIs that loops will use, for instance: 'set_running_event_loop()'.  This won't 
be the first case of event loop policy APIs being called from event loops -- 
another example is the `get_child_watcher` method.

With this new method, `Loop._run` will then look like this:

  def _run(self):
  policy = get_event_loop_policy()
  policy.set_running_event_loop(self)
  try:
 ... # current Loop._run implementation
  finally:
  policy.set_running_event_loop(None)

`policy.set_running_event_loop` call would raise a RuntimeError if it's called 
if another event loop is currently running.

And the `get_event_loop()` function will look like this:

  def get_event_loop():
  policy = get_event_loop_policy()
  loop = policy._get_running_event_loop()
  if loop is not None:
  return loop
  # ... current get_event_loop implementation

So it all boils down to:

1. Adding a new policy API 'set_running_event_loop'.

2. Updating 'get_event_loop' to return the currently running event loop if it's 
available, or else resorting to its current behaviour.

With this change it will be completely safe to use "get_event_loop" from 
running coroutines or just about any code that runs in a context of an event 
loop.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Guido van Rossum

Guido van Rossum added the comment:

As long as there are still things you find confusing about asyncio's model,
you should probably consider yourself unqualified to start proposing new
features...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Terry Reedy

On 5/10/2016 11:35 AM, pcmantic...@gmail.com wrote:


The bad-builtin check is now an extension, so using the first case
would enable it.


The 'old' (not 'bad') builtin check should include using map instead of 
a comprehension.  The check should also pay attention to whether the 
function argument is an existing function or a one newly created with a 
lambda expression.  "'lambda' in "


I think filter(None, iterable) (== filter(bool, iterable)) should be 
separately flagged as a style point.  It is a hack that became unneeded 
when bool was added.



Another thing that is going to change with the next release is
the introduction of tiers. Basically, pylint overwhelms the user
right now with its enabled checks and we're trying to split these
into tiers, as seen in the following:


This looks good.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Terry Reedy

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 that the
feedback had to come in rather a harsh manner, on this group,
instead of being reported as a bug or an enhancement on pylint's
bug tracker.


My impression is that the objection to 'bad builtin' was communicated 
somehow to someone involved with PyLint  at least a year ago and ignored 
or outright rejected.  But I don't remember details.  I might be 
mistaken or have been given false information.



Anyway, I wanted to tell you that I agree with your opinion
regarding that message and as such, it is removed and won't be
emitted anymore in the next release (1.6)


Then my harsh comment re pylint is not currently valid.  Thank you.

Hiring managers misusing the score to evaluate applicants is a different 
issue.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: json.loads(...) ValueError: Expecting value: line 1 column 1 (char 0)

2016-05-10 Thread zljubisic
That was it.
Thanks guys for your help.
Best regards.
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] Reminder: Summer School "Advanced Scientific Programming in Python" in Reading, UK, September 5—11, 2016

2016-05-10 Thread Zbigniew Jędrzejewski-Szmek
Reminder: Deadline for application is 23:59 UTC, May 15, 2016.


Advanced Scientific Programming in Python
=
a Summer School by the G-Node, and the Centre for Integrative Neuroscience and 
Neurodynamics, School of Psychology and Clinical Language Sciences, University 
of Reading, UK

Scientists spend more and more time writing, maintaining, and debugging 
software. While techniques for doing this efficiently have evolved, only few 
scientists have been trained to use them. As a result, instead of doing their 
research, they spend far too much time writing deficient code and reinventing 
the wheel. In this course we will present a selection of advanced programming 
techniques and best practices which are standard in the industry, but 
especially tailored to the needs of a programming scientist. Lectures are 
devised to be interactive and to give the students enough time to acquire 
direct hands-on experience with the materials. Students will work in pairs 
throughout the school and will team up to practice the newly learned skills in 
a real programming project — an entertaining computer game.

We use the Python programming language for the entire course. Python works as a 
simple programming language for beginners, but more importantly, it also works 
great in scientific simulations and data analysis. We show how clean language 
design, ease of extensibility, and the great wealth of open source libraries 
for scientific computing and data visualization are driving Python to become a 
standard tool for the programming scientist.

This school is targeted at Master or PhD students and Post-docs from all areas 
of science. Competence in Python or in another language such as Java, C/C++, 
MATLAB, or Mathematica is absolutely required. Basic knowledge of Python and of 
a version control system such as git, subversion, mercurial, or bazaar is 
assumed. Participants without any prior experience with Python and/or git 
should work through the proposed introductory material before the course.

We are striving hard to get a pool of students which is international and 
gender-balanced.

You can apply online: https://python.g-node.org
Application deadline: 23:59 UTC, May 15, 2016.
Be sure to read the FAQ before applying. 

Participation is for free, i.e. no fee is charged! Participants however should 
take care of travel, living, and accommodation expenses by themselves. Travel 
grants may be available.

Date & Location
===
September 5—11, 2016. Reading, UK

Program
===
- Best Programming Practices
  • Best practices for scientific programming
  • Version control with git and how to contribute to open source projects with 
GitHub
  • Best practices in data visualization

- Software Carpentry
  • Test-driven development
  • Debugging with a debuggger
  • Profiling code

- Scientific Tools for Python
  • Advanced NumPy

- Advanced Python
  • Decorators
  • Context managers
  • Generators

- The Quest for Speed
  • Writing parallel applications
  • Interfacing to C with Cython
  • Memory-bound problems and memory profiling
  • Data containers: storage and fast access to large data

- Practical Software Development
  • Group project

Faculty
===

• Francesc Alted, freelance consultant, author of Blosc, Spain
• Pietro Berkes, Enthought Inc., Cambridge, UK
• Zbigniew Jędrzejewski-Szmek, Krasnow Institute, George Mason University, 
Fairfax, VA, USA
• Eilif Muller, Blue Brain Project, École Polytechnique Fédérale de Lausanne, 
Switzerland
• Rike-Benjamin Schuppner, Institute for Theoretical Biology, 
Humboldt-Universität zu Berlin, Germany
• Bartosz Teleńczuk, European Institute for Theoretical Neuroscience, CNRS, 
Paris, France
• Stéfan van der Walt, Berkeley Institute for Data Science, UC Berkeley, CA, USA
• Nelle Varoquaux, Centre for Computational Biology Mines ParisTech, Institut 
Curie, U900 INSERM, Paris, France
• Tiziano Zito, freelance consultant, Germany

Organizers
==
For the German Neuroinformatics Node of the INCF (G-Node) Germany:
• Tiziano Zito, freelance consultant, Germany
• Zbigniew Jędrzejewski-Szmek, Krasnow Institute, George Mason University, 
Fairfax, USA
• Jakob Jordan, Institute of Neuroscience and Medicine (INM-6), 
Forschungszentrum Jülich GmbH, Germany

For the Centre for Integrative Neuroscience and Neurodynamics, School of 
Psychology and Clinical Language Sciences, University of Reading UK:
• Etienne Roesch, Centre for Integrative Neuroscience and Neurodynamics, 
University of Reading, UK

Website: https://python.g-node.org
Contact: python-i...@g-node.org
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: An educational site written in Python (from YCombinator's RFS)

2016-05-10 Thread DFS

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 eventually do everything else on this
list. The first attempts to use technology to fix education have
focused on using the Internet to distribute traditional content to a
wider audience. This is good, but the Internet is a fundamentally
different medium and capable of much more.

Solutions that combine the mass scale of technology with one-on-one
in-person interaction are particularly interesting to us.


one room, one teacher, one student, and one web browser?




This may not require a "breakthrough" technology in the classical
sense, but at a minimum it will require very new ways of doing
things.

---

 I want to create such a site using Python. What are the various
steps I need to take to create such a site ? This is a big project,
but one that is worth doing ... Any suggestions / help appreciated ?
Thanks alot



When you say 'such a site' what do you envision?

--
https://mail.python.org/mailman/listinfo/python-list


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

2016-05-10 Thread Ilya Kulakov

Ilya Kulakov added the comment:

Yury, we're building our own CPython anyway (and we just updated to 3.5.1). I'd 
be glad to test the patch during the next iteration.

Guido, I think my use case mixes up other things I find confusing about 
asyncio: e.g. inablitity to synchronously perform code written as standalone 
coroutine. It deserves its own task and discussion.

The purpose of this request is that access to a running loop is handy within 
coroutine. It's already there, since coroutine is executed within its context. 
However, instead of "self" library provides API to only access some globally 
default loop.

Python does not require a user to pass self whenever instance methods needs to 
be called. I consider relationship between event loop and awaitables alike.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26983] float() can return not exact float instance

2016-05-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch makes float() always returning exact float.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file42807/float_exact.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Guido van Rossum

Guido van Rossum added the comment:

Yury, what do you think of this yourself? Maybe you can explain it better
than Ilya?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-05-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Suddha: Someone has to write a currently failing test and a patch that makes it 
pass without breaking anything else.  I cannot currently test this issue and 
therefore cannot currently patch it.  AutoComplete has numerous other issues 
that I can test.  About a month ago, I reviewed the code with an eye to fixing 
them.  I decided what I implied above, which is that I should not do anything 
until I can freely modify the code.  I just filed #26993 to make that possible.

Paul: For testing CPython in general, see https://docs.python.org/devguide/, 
chapter 4 and 5 (and the unittest docs).  For testing IDLE, see test/test_idle 
and idlelib/idle_test, in particular README and htest.py.  The latter is 
specific to IDLE.  If #26993 is approved, we will need LOTS of new tests for 
IDLE, as I want to properly follow the *written* failing test, write patch, 
passing test paradigm.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Yury Selivanov

Yury Selivanov added the comment:

Ilya, at this point I'd suggest you to craft a very clear and simple to digest 
email to python-ideas describing 'get_running_loop()', how it can be used, your 
case, other cases, etc.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Guido van Rossum

Guido van Rossum added the comment:

Still no green light. Ilya just seems to want something misguided.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Yury Selivanov

Yury Selivanov added the comment:

> Yury, could you submit a patch implements this feature?

Yes, the patch part is easy. The hard part is to get a green light from Guido 
on adding the 'get_running_loop()' function...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26995] Add tests for parsing float and object arguments

2016-05-10 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch adds tests for direct testing argument parsing C API with format 
units "f", "d", "D" (float, double, complex) and "S", "Y", "U" (PyObject* of 
type bytes, bytearray and str).

--
components: Tests
files: test_getargs_floats_objects.patch
keywords: patch
messages: 265261
nosy: mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add tests for parsing float and object arguments
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42806/test_getargs_floats_objects.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26994] unexpected behavior for booleans in argparse

2016-05-10 Thread Nathan Naze

Nathan Naze added the comment:

I also buy the argument that changing the behavior now would be problematic 
given the existing usages in the wild.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26994] unexpected behavior for booleans in argparse

2016-05-10 Thread Nathan Naze

Nathan Naze added the comment:

> It does 'bool(value)', and 'bool("False")' is True, since "False" is a 
> non-empty string.

Yes, I understand this. It's fine to mark as "working as intended", but coming 
from other flag-parsing libraries, I find the behavior unintuitive and do not 
understand the utility of accepting arbitrary strings given the  potential for 
user confusion. We uncovered this behavior debugging a script used internally 
at Google.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Ilya Kulakov

Ilya Kulakov added the comment:

Yury, could you submit a patch implements this feature?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: The irony

2016-05-10 Thread Tim Chase
(interspersing letters to name your examples)

On 2016-05-10 14:03, DFS wrote:

A (nope)
> ---
> sSQL =  "line 1\n"
> sSQL += "line 2\n"
> sSQL += "line 3"

B (see below)
> ---
> sSQL = ("line 1\n"
>  "line 2\n"
>  "line 3")

C (see below)
> ---
> sSQL = "\n".join([
>   "line 1",
>   "line 2",
>   "line 3",
> ])

D (almost)
> ---
> sSQL =  """line 1
> line 2
> line 3"""

E (almost)
> ---
> sSQL = """\
> line 1
> line 2
> line 3"""

F (not bad)
> ---
> sSQL = "line 1\n" \
> "line 2\n" \
> "line 3"

> Which is the "one obvious way" to do it?

Readability is one of Python's key strengths.  I find my choice(s)
influenced by ease-of-reading and ease-of-editing (along with its
friend, ease-of-reading-diffs).

As leading indentation doesn't usually matter in SQL, I tend to just
use triple-quoted strings for all my SQL, formatting so it looks like
good SQL:

  sql = """
SELECT
  a.foo,
  b.bar
FROM tblA a
  INNER JOIN tblB b
  ON a.id = b.a_id
WHERE
  a.osteopathy > b.saturation
ORDER BY
  b.monkey_balloon
"""

This does mean that there's a superfluous newline at the beginning &
end of the string and unneeded indentation for each line. But SQL
doesn't care, and if it had any noticeable performance issue (ooh, a
couple dozen extra bytes getting sent over the wire), it could be
post-processed to a clean one-liner.

That said, there are cases where the leading indentation does matter
to you, then I tend to use your "C" example for code executed once,
or a modification of B for code in loops:

  sql = (
"line1\n"
"line2\n"
"line3"
)

(the difference being the newline after the open-paren to align all
the strings' starting offset)

If the redundancy of the "\n" characters became sufficiently
annoying, I'd define a constant (evaluated once, not in a loop) using
the "\n".join(...) method.

Seek the code that reads best for you and meets your needs.

-tkc





-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The irony

2016-05-10 Thread Ned Batchelder
On Tuesday, May 10, 2016 at 2:03:47 PM UTC-4, DFS wrote:
> Which is the "one obvious way" to do it?
> 
> I liked:
> 
> sSQL =  "line 1\n"
> sSQL += "line 2\n"
> sSQL += "line 3"
> 
> 
> but it's frowned upon in PEP8.

I would use a way you didn't show:

sSQL = """
line1
line2
line3
"""

SQL doesn't mind the extra whitespace, so don't worry about the leading
spaces.  If you really wanted to control it tightly, I would use (and have
used):

sSQL = textwrap.dedent("""\
line1
line2
line3
""")

--Ned.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26994] unexpected behavior for booleans in argparse

2016-05-10 Thread R. David Murray

R. David Murray added the comment:

type=bool doesn't do what you think it does.  It does 'bool(value)', and 
'bool("False")' is True, since "False" is a non-empty string.

See issue 21208 for some further discussion.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Change default behavior of arguments with type bool when 
options are specified

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Michael Felt

Changes by Michael Felt :


Added file: 
http://bugs.python.org/file42805/Python3.Modules._ctypes.160510.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26994] unexpected behavior for booleans in argparse

2016-05-10 Thread Nathan Naze

New submission from Nathan Naze:

Setting a boolean type in argparse gives unexpected behavior when setting 
"True", "False", etc.

https://gist.github.com/nanaze/db63e3f63e318408e3223bf1245d9752

Would have expected parsing to fail for unclear input that doesn't neatly map 
to a boolean value.

--
components: Library (Lib)
messages: 265256
nosy: Nathan Naze
priority: normal
severity: normal
status: open
title: unexpected behavior for booleans in argparse
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Michael Felt

Changes by Michael Felt :


Added file: http://bugs.python.org/file42804/Python3.Lib.ctypes.160510.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Michael Felt

Changes by Michael Felt :


Added file: 
http://bugs.python.org/file42803/Python2.Modules._ctypes.160510.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24225] Idlelib: changing file names

2016-05-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Alternate proposal is #26993.

--
versions:  -Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26993] Copy idlelib *.py files with new names

2016-05-10 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Proposal: duplicate nearly all of the existing idlelib *.py files, with new 
names.  This would implement the intention of PEP 434 with respect to freely 
changing idlelib APIs.  I view it as a prerequisite for most anticipated 
patches.  A longer than usual explanation follows.

Last August/September, I realized that the way to modernize and improve IDLE, 
while maintaining backward compatibility, would be to add copies of existing 
.py files.  The copies with new names (the idle3 set) could be freely edited  
while existing files (the idle2 set) could be pretty much left alone until 
deleted.  IDLE would temporarily, for a time yet to be decided, have two 
operating modes.  The idle2 mode would only use exiting files and tk widgets.  
The idle3 mode would use new files and ttk widgets.

Renaming and refactoring files, including PEP 8 updates, is needed for bug 
fixing, testing, and feature upgrades, including addition of a single window 
multiple pane design.  However, doing so with existing files would break direct 
imports and subsequent calls (see #24225, for some discussion).  Ttk widgets 
cannot be used on systems with tcl/tk 8.4. (This and related issues was 
discussed with Nick, Ned, and release managers, as well as in #24759, 
especially msg247993 & msg248031, and in #24750).

I originally planned to add new files one or a few at a time.  I did not start 
doing do immediately, before the November-December releases, because I wanted 
to fix some bugs in the existing files before they were bifurcated. I did not 
start doing so after the releases because I could not figure out how to safely 
manage an 'idle3/ttk' mode that mixed a shrinking subset of idle2 files and the 
growing set of new idle3 files.  It seemed like a recipe for introducing bugs.  
I decided instead that the best solution would be to create a complete, tested 
idle3 set all at once, using the following steps.  (Idlelib/idle_test/*.py 
files will be handled similarly, but with differences discussed later.)

0. Decide on the new names.
1. Copy idlelib/*.py files and hg add them.
2. Revise imports in new idle3 files.
3. Test to make sure that the idle3 set works right. 
4. Upload patch for review, and commit.

Possible variation: push after step 1, so that the revisions in step 2 are a 
separate patch instead of being folded into a combined patch.  I do not propose 
that because the new files would be useless until revised.


DETAILS OF CURRENT PLAN:

0. @newnames.txt, https://bugs.python.org/file42678/%40newnames.txt is attached 
to issue #24225.  It lists old name, Sweigart's new name, and my current new 
name.  Bikeshedding names can be done on that issue.

Leaving aside the unused and deprecated 'idlever' and the startup files, all of 
which are omitted from the list, there are currently three short lowercase 
names: 'help', 'rpc', and 'run'.  To reuse these names for the idle3 set, these 
could be renamed, in a preliminary patch, to have a captital letter.  I think 
this should be okay because  'help' specifies that is it subject to change, and 
the other two are extremely unlikely to be used outside of IDLE.  If this were 
done, implementation files could be identified as 'idle2' versus 'idle3' by the 
presence of an uppercase letter in the name.

Serhiy requested on #24225 that renames of existing 3.5 files be backported to 
2.7.  Since I do not anticipate many patches to idle2 files, let alone 
backports to 2.7, I am not sure that this is needed.

Alternatively, I could name the copies help3, rpc3, and run3.

1. Use the name list from step 0 to create copyall.bat, to be run in the 3.5 
repository idlelib directory.  It will have 'copy src dst' for each file and 
end with 'hg add ../idlelib' (or 'cd ..; hg add idlelib') to 'add' them all.  I 
am aware of 'hg copy', but the docs are not clear on whether there is any 
lingering effect after pushing the adds.  The pre-commit merge effect seems 
unneeded as no one else is pushing idlelib commits (except Serhiy ocassionally, 
as part of multifile patches, and he should be reading this ;-).

2. Review Al Sweigart's 'idle_updating_imports.patch' from #24225.  Al ran 
revised unittests, but the coverage is too spotty to adequately test.  So 
review is needed.

The tricky part is that many modules and classes have the same name, such as 
AutoComplete the module and AutoComplete the class.  Module references must be 
changed to the new name; class references must not be touched.  I would use 
IDLE's File in Files (grep) with each module name to find references to check.  
The import in each client module ('import X' versus 'from X import X' 
determines how bare 'X' is used in rest of the module.

If the patch seems correct, or mostly so, perhaps after a few corrections,  
write a script, using the step 0 name list, to replace Al's new names with my 
new names, where they are different.

Apply the patch.  Since Al's patch is a year old, some chunks 

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

2016-05-10 Thread Michael Felt

Changes by Michael Felt :


Added file: http://bugs.python.org/file42802/Python2.Lib.ctypes.160510.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-05-10 Thread Michael Felt

Michael Felt added the comment:

Spent more time today, testing - on 3.5.1, 3.4.4 and 2.7.11.

The patches would not apply on both Python2 and Python3, but the new file 
Lib/ctypes/aixutil.py is identical on all three versions.

History of patching (starting from version 3.5.1(.1) is my patched version (as 
are Python-3.4.4.1 and Python-2.7.11.4)

michael@x071:[/data/prj/aixtools/python/python-3.4.4.1]for i in 
../*patches/*patch^Jdo^Jcat $i | patch -p1 ^Jdone
patching file Lib/ctypes/__init__.py
Hunk #1 succeeded at 341 (offset 4 lines).
patching file Lib/ctypes/test/test_loading.py
patching file Lib/ctypes/util.py
Hunk #1 succeeded at 70 (offset -6 lines).
Hunk #2 succeeded at 256 (offset -6 lines).
Hunk #3 succeeded at 275 (offset -6 lines).
patching file Modules/_ctypes/_ctypes.c
Hunk #1 succeeded at 5508 (offset -1 lines).
michael@x071:[/data/prj/aixtools/python/python-3.4.4.1]

But, not with 2.7.11

michael@x071:[/data/prj/aixtools/python/python-2.7.11.4]for i in 
../*patches/*patch^Jdo^Jcat $i | patch -p1 --dry-run^Jdone
patching file Lib/ctypes/__init__.py
Hunk #1 succeeded at 355 (offset 18 lines).
patching file Lib/ctypes/test/test_loading.py
Hunk #1 succeeded at 38 (offset -5 lines).
patching file Lib/ctypes/util.py
Hunk #1 succeeded at 71 (offset -5 lines).
Hunk #2 FAILED at 262.
Hunk #3 FAILED at 274.
2 out of 3 hunks FAILED -- saving rejects to file Lib/ctypes/util.py.rej
patching file Modules/_ctypes/_ctypes.c
Hunk #1 FAILED at 5509.
1 out of 1 hunk FAILED -- saving rejects to file Modules/_ctypes/_ctypes.c.rej

So, I made new patches against 2.7.11 after patching manually.

After the builds:

==
aixtools.python:aixtools.python.man.en_US:2.7.11.4::I:T:N:man pages0::
aixtools.python:aixtools.python.rte:2.7.11.4::I:T:N:built 10-May-2016 1810 
UTC0::
==
root@x064:[/data/prj/aixtools/python/python-2.7.11.4]cd Lib/ctypes
root@x064:[/data/prj/aixtools/python/python-2.7.11.4/Lib/ctypes]../../python 
util.py
None
libc.a(shr.o)
libbz2.a(libbz2.so)
('aix.find_library("libiconv.so")', 'libiconv.a(shr4.o)')
('aix.find_library("libintl.so")', 'libintl.a(libintl.so.1)')
('aix.find_library("libintl.so.1")', 'libintl.a(libintl.so.1)')
('aix.find_library("libintl.so.2")', None, ':: should be None!')
('aix.find_library("libintl.so.8")', None)



libcrypt.a(shr.o)
root@x064:[/data/prj/aixtools/python/python-2.7.11.4/Lib/ctypes]../../python 
test/test_loading.py
libc_name is libc.a(shr.o)
ss..sss
--
Ran 7 tests in 0.189s

OK (skipped=5)

==
aixtools.python:aixtools.python.man.en_US:3.4.4.1::I:T:N:man pages0::
aixtools.python:aixtools.python.rte:3.4.4.1::I:T:N:built 10-May-2016 1812 
UTC0::
==
root@x064:[/data/prj/aixtools/python/python-3.4.4.1]cd Lib/ctypes
root@x064:[/data/prj/aixtools/python/python-3.4.4.1/Lib/ctypes]../../python 
util.py
None
libc.a(shr.o)
libbz2.a(libbz2.so)
aix.find_library("libiconv.so") libiconv.a(shr4.o)
aix.find_library("libintl.so") libintl.a(libintl.so.1)
aix.find_library("libintl.so.1") libintl.a(libintl.so.1)
aix.find_library("libintl.so.2") None :: should be None!
aix.find_library("libintl.so.8") None



libcrypt.a(shr.o)
root@x064:[/data/prj/aixtools/python/python-3.4.4.1/Lib/ctypes]../../python 
test/test_loading.py
libc_name is libc.a(shr.o)
ss..sss
--
Ran 7 tests in 0.323s

OK (skipped=5)

root@x064:[/data/prj/aixtools/python/python-3.5.1.1]installp -d . -L
aixtools.python:aixtools.python.man.en_US:3.5.1.0::I:T:N:man pages0::
aixtools.python:aixtools.python.man.en_US:3.5.1.1::I:T:N:man pages0::
aixtools.python:aixtools.python.rte:3.5.1.0::I:T:N:built 03-Mar-2016 0856 
UTC0::
aixtools.python:aixtools.python.rte:3.5.1.1::I:T:N:built 10-May-2016 1620 
UTC0::

And, with a 64-bit build

root@x064:[/data/prj/aixtools/python/python-3.5.1.1]installp -d . -L
aixtools.python:aixtools.python.man.en_US:3.5.1.0::I:T:N:man pages0::
aixtools.python:aixtools.python.man.en_US:3.5.1.1::I:T:N:man pages0::
aixtools.python:aixtools.python.rte:3.5.1.0::I:T:N:built 03-Mar-2016 0856 
UTC0::
aixtools.python:aixtools.python.rte:3.5.1.1::I:T:N:built 10-May-2016 1620 
UTC0::
root@x064:[/data/prj/aixtools/python/python-3.5.1.1]cd lib/ctypes
ksh: lib/ctypes:  not found.
root@x064:[/data/prj/aixtools/python/python-3.5.1.1]cd Lib/ctypes
root@x064:[/data/prj/aixtools/python/python-3.5.1.1/Lib/ctypes]../../python 
util.py
None
libc.a(shr_64.o)
None
aix.find_library("libiconv.so") libiconv.a(shr4_64.o)
aix.find_library("libintl.so") libintl.a(libintl.so.1)
aix.find_library("libintl.so.1") libintl.a(libintl.so.1)
aix.find_library("libintl.so.2") None :: should be None!
aix.find_library("libintl.so.8") None



libcrypt.a(shr_64.o)

Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Ian Kelly
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 subject line edited.
>
>
>
> huh?  You called yourself a "master crafts/wo/man".

Stop trolling.

> --
> DFS: "python is awesome, but too many options for doing the same thing also
> makes it difficult.  For me, anyway."
>
> DuhPricko: "That's the difference between a master and an apprentice. The
> apprentice likes to follow fixed steps the same way each time. The master
> craftsman knows her tools backwards, and can choose the right tool for the
> job, and when the choice of tool really doesn't matter and you can use
> whatever happens to be the closest to hand."
> --

So what, you're upset by the implication that you haven't already
mastered Python when you apparently just started a couple months ago?
Temper your expectations.

> 'master craftswoman' my ass...

Take your gender insults somewhere else. They're not welcome here.
-- 
https://mail.python.org/mailman/listinfo/python-list


The irony

2016-05-10 Thread DFS

"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")
---
sSQL = "\n".join([
 "line 1",
 "line 2",
 "line 3",
   ])
---
sSQL =  """line 1
line 2
line 3"""
---
sSQL = """\
line 1
line 2
line 3"""
---
sSQL = "line 1\n" \
   "line 2\n" \
   "line 3"
---


Which is the "one obvious way" to do it?

I liked:

sSQL =  "line 1\n"
sSQL += "line 2\n"
sSQL += "line 3"


but it's frowned upon in PEP8.


--
https://mail.python.org/mailman/listinfo/python-list


Re: An educational site written in Python (from YCombinator's RFS)

2016-05-10 Thread Ned Batchelder
On Tuesday, May 10, 2016 at 2:13:42 AM UTC-4, Cai Gengyang wrote:
> 
> EDUCATION
> 
> If we can fix education, we can eventually do everything else on this list.
> The first attempts to use technology to fix education have focused on using 
> the Internet to distribute traditional content to a wider audience. This is 
> good, but the Internet is a fundamentally different medium and capable of 
> much more.
> 
> Solutions that combine the mass scale of technology with one-on-one in-person 
> interaction are particularly interesting to us.
> 
> This may not require a "breakthrough" technology in the classical sense, but 
> at a minimum it will require very new ways of doing things.
> 
> ---
> 
> I want to create such a site using Python. What are the various steps I need 
> to take to create such a site ? This is a big project, but one that is worth 
> doing ... Any suggestions / help appreciated ? Thanks alot


If you want to join an existing project, Open edX is open-source Python/Django, 
and powers edx.org and 250 other sites around the world.  I'm guessing it isn't 
quite what this proposal is getting at, but the description here is very vague, 
so I'm not sure what they are getting at.

http://open.edx.org if you want to take a look.

--Ned.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What should a decorator do if an attribute already exists?

2016-05-10 Thread Ethan Furman

On 05/10/2016 08:45 AM, Steven D'Aprano wrote:


I have a decorator that adds an attribute to the decorated function:



My question is, what should I do if the decorated function already has an
instrument attribute?


If the decorator is adding an attribute for the decorated thing to use, 
and that thing may already have the correct attribute, do nothing; 
otherwise, raise an exception.


--
~Ethan~

--
https://mail.python.org/mailman/listinfo/python-list


[issue14209] pkgutil.iter_zipimport_modules ignores the prefix parameter for packages

2016-05-10 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: What should a decorator do if an attribute already exists?

2016-05-10 Thread MRAB

On 2016-05-10 17:06, Stephen Hansen wrote:

On Tue, May 10, 2016, at 08:45 AM, Steven D'Aprano wrote:

I have a decorator that adds an attribute to the decorated function:
[...]
My question is, what should I do if the decorated function already has an
instrument attribute?

1. raise an exception?


This. Your decorator should, IMHO, treat the attribute as private data,
and if something else is using the same thing, something has clearly
gone wrong and raising the error early and clearly is right.

If it's not clear what you should do, you could look at the Zen. It 
says: "In the face of ambiguity, refuse the temptation to guess." To me, 
that suggests raising an exception.


--
https://mail.python.org/mailman/listinfo/python-list


Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Steven D'Aprano
On Wed, 11 May 2016 02:16 am, DFS wrote:

> huh?  You called yourself a "master crafts/wo/man".
[...]
> DuhPricko


*plonk*


-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What should a decorator do if an attribute already exists?

2016-05-10 Thread Peter Otten
Steven D'Aprano wrote:

> I have a decorator that adds an attribute to the decorated function:
> 
> 
> def decorate(func):
> instrument = make_instrument()
> 
> @functools.wraps(func)
> def inner(*args):
> instrument.start()
> result = func(*args)
> instrument.finish()
> return result
> 
>inner.instrument = instrument
>return inner
> 
> 
> The actual nature of the instrumentation isn't important: depending on the
> decorator, it might count the number of function calls made, how long it
> takes, count cache hits, or something else.
> 
> My question is, what should I do if the decorated function already has an
> instrument attribute?
> 
> 1. raise an exception?
> 
> 2. raise a warning, and over-write the attribute?
> 3. raise a warning, and skip adding the attribute?
> 4. raise a warning, and rename the existing instrument to
>something else before writing my own instrument?
> 
> 5. silently over-write the attribute?
> 
> 
> I think 5 is clearly wrong, 4 is too difficult, and 3 seems pointless. So
> I think either 1 or 2 is the right thing to do.
> 
> Thoughts?

Silently overwrite it. For

@decorate
@decorate
def f():
pass

the original instrument is still accessible as f.__wrapped__.instrument, so 
5 is the easy way to get 4.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Rustom Mody
On Tuesday, May 10, 2016 at 9:46:45 PM UTC+5:30, 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 subject line edited.
> 
> 
> huh?  You called yourself a "master crafts/wo/man".
> 
> 
> DuhPricko:
> 
> 
> But no, "master", your answers are incorrect.  What's wrong with that 

> 'master craftswoman' my ass...

You do a good job

This your teacher?

https://www.youtube.com/watch?v=FMEe7JqBgvg
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Stephen Hansen
On Tue, May 10, 2016, at 09:16 AM, DFS wrote: 
> But no, "master", your answers are incorrect.  What's wrong with that 
> concat statement is that += concatenation is frowned upon by python's 
> creator, and is not recommended (in PEP8):
> 
> 
> Code should be written in a way that does not disadvantage other 
> implementations of Python (PyPy, Jython, IronPython, Cython, Psyco, and 
> such).
> 
> For example, do not rely on CPython's efficient implementation of 
> in-place string concatenation for statements in the form a += b or a = a 
> + b . This optimization is fragile even in CPython (it only works for 
> some types) and isn't present at all in implementations that don't use 
> refcounting. In performance sensitive parts of the library, the 
> ''.join() form should be used instead. This will ensure that 
> concatenation occurs in linear time across various implementations.
> 

You once again misread PEP8. 

Not one of Steven's answers used string concatenation, except for the
implicit literal concatenation, which all other implementations support.

Note:

> sSQL = """line 1
> line 2
> line 3"""

No concatenation. One string literal. Works in all implementations.

> sSQL = "line 1\nline 2\nline 3"

No concatenation. One string literal. Works in all implementations.

>
> sSQL = ("line 1\n"
> "line 2\n"
> "line 3")

Concatenation occurs at compile time, implicitly. Works in all
implementations.

The PEP says when building a string dynamically (that is, adding
together two strings that exist and are separate), use "".join() in
performance sensitive places. It says don't combine two strings with the
addition operator -- because while that's sometimes efficient in
CPython, the language doesn't guarantee it.

You'll notice that the one time Steven combined two strings, it was
implicitly at compile time.

In every Python implementation, it is guaranteed that:

>>> a = "a" "a"
>>> b = "aa"

Are the same. Two+ string literals are implicitly combined into one at
compile time.

> 'master craftswoman' my ass...

Yes, you're being that. Please stop.

-- 
Stephen Hansen
  m e @ i x o k a i . i o
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue22247] More incomplete module.__all__ lists

2016-05-10 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26632] __all__ decorator

2016-05-10 Thread John Mark Vandenberg

Changes by John Mark Vandenberg :


--
nosy: +jayvdb

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread DFS

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 called yourself a "master crafts/wo/man".

--
DFS: "python is awesome, but too many options for doing the same thing 
also makes it difficult.  For me, anyway."


DuhPricko: "That's the difference between a master and an apprentice. 
The apprentice likes to follow fixed steps the same way each time. The 
master craftsman knows her tools backwards, and can choose the right 
tool for the job, and when the choice of tool really doesn't matter and 
you can use whatever happens to be the closest to hand."

--




Since all three lines are constants know by the programmer at the time the
source code is written, it should be written as:


sSQL = """line 1
line 2
line 3"""

Or if you prefer:

sSQL = "line 1\nline 2\nline 3"


Or even:

sSQL = ("line 1\n"
"line 2\n"
"line 3")

taking advantage of Python's compile-time implicit concatenation of string
constants.


or

sSQL = "line 1\n" \
 "line 2\n" \
 "line 3"



But no, "master", your answers are incorrect.  What's wrong with that 
concat statement is that += concatenation is frowned upon by python's 
creator, and is not recommended (in PEP8):



Code should be written in a way that does not disadvantage other 
implementations of Python (PyPy, Jython, IronPython, Cython, Psyco, and 
such).


For example, do not rely on CPython's efficient implementation of 
in-place string concatenation for statements in the form a += b or a = a 
+ b . This optimization is fragile even in CPython (it only works for 
some types) and isn't present at all in implementations that don't use 
refcounting. In performance sensitive parts of the library, the 
''.join() form should be used instead. This will ensure that 
concatenation occurs in linear time across various implementations.



https://www.python.org/dev/peps/pep-0008/#programming-recommendations



'master craftswoman' my ass...

--
https://mail.python.org/mailman/listinfo/python-list


Re: What should a decorator do if an attribute already exists?

2016-05-10 Thread Stephen Hansen
On Tue, May 10, 2016, at 08:45 AM, Steven D'Aprano wrote:
> I have a decorator that adds an attribute to the decorated function:
> [...]
> My question is, what should I do if the decorated function already has an
> instrument attribute?
> 
> 1. raise an exception?

This. Your decorator should, IMHO, treat the attribute as private data,
and if something else is using the same thing, something has clearly
gone wrong and raising the error early and clearly is right.

-- 
Stephen Hansen
  m e @ i x o k a i . i o
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26925] android: test_multiprocessing_main_handling fails

2016-05-10 Thread Berker Peksag

Changes by Berker Peksag :


--
stage:  -> resolved
superseder:  -> android: test_concurrent_futures fails

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



What should a decorator do if an attribute already exists?

2016-05-10 Thread Steven D'Aprano
I have a decorator that adds an attribute to the decorated function:


def decorate(func):
instrument = make_instrument()

@functools.wraps(func)
def inner(*args):
instrument.start()
result = func(*args)
instrument.finish()
return result

   inner.instrument = instrument
   return inner


The actual nature of the instrumentation isn't important: depending on the
decorator, it might count the number of function calls made, how long it
takes, count cache hits, or something else.

My question is, what should I do if the decorated function already has an
instrument attribute?

1. raise an exception?

2. raise a warning, and over-write the attribute?
3. raise a warning, and skip adding the attribute?
4. raise a warning, and rename the existing instrument to 
   something else before writing my own instrument?

5. silently over-write the attribute?


I think 5 is clearly wrong, 4 is too difficult, and 3 seems pointless. So I
think either 1 or 2 is the right thing to do.

Thoughts?



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread pcmanticore
On Tuesday, May 10, 2016 at 5:58:37 PM UTC+3, Steven D'Aprano wrote:
> Hi Claudiu,
> 
> 
> On Tue, 10 May 2016 11:51 pm, 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 that the
> > feedback had to come in rather a harsh manner, on this group,
> > instead of being reported as a bug or an enhancement on pylint's
> > bug tracker.
> >
> > Anyway, I wanted to tell you that I agree with your opinion
> > regarding that message and as such, it is removed and won't be
> > emitted anymore in the next release (1.6)
> 
> Thanks for being so understanding!
> 
> Speaking for myself, I think that the test for filter versus list
> comprehensions is a reasonable test to include, so long as it is disabled
> by default. Does PyLint support opt-in checks?
> 
> 
> 
> -- 
> Steven


Hi Steven,

Yes, pylint is pretty configurable regarding its checks.
First of all, we have extensions, which are checks which were
found unsuitable to be part of the core, thus they need to be
manually activated, as in:

$ pylint --load-plugins=pylint.extensions.name_of_the_extension

We also have a group of checks that are disabled by default, as
is the case of the Python 3 porting checker, recommended as well
by the Python 3 porting guide
(https://docs.python.org/3/howto/pyporting.html?highlight=pylint)
These needs to be enabled manually, as in:

$ pylint --enable=python3
$ pylint --enable=other_disabled_group

Last, but not least, each check can be (de)activated manually:

$ pylint --disable=no-member
# don't care about conventions and refactoring warnings
$ pylint --disable=C,R
$ pylint --disable=all --enable=no-member,other_check_I_want

The bad-builtin check is now an extension, so using the first case
would enable it.

Another thing that is going to change with the next release is
the introduction of tiers. Basically, pylint overwhelms the user
right now with its enabled checks and we're trying to split these
into tiers, as seen in the following:

$ pylint myproject
# core checkers enabled
10/10 - Congrats, you're clean on a core. You might try with "--pedantic" 
now.

$ pylint myproject --pedantic
# pedantic checkers enabled.
10/10 - Congrats, you're clean on pedantic. You might try with 
--refactoring now

$ pylint myproject --refactoring
# refactoring checkers enabled
10/10 - Congrats, you're clean on refactoring. Last up, try with --style 
now.

$ pylint myproject --style
10/10 - Now you're pylint clean.

Or running them all:

$ pylint myproject --all

(The discussion and whatnot can be found here
https://github.com/PyCQA/pylint/issues/746)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Steven D'Aprano
A further comment:

On Tue, 10 May 2016 11:51 pm, Claudiu Popa wrote:

> Thank you for letting us know. While pylint is indeed
> opinionated in some cases, we're not trying to be
> "arrogant", 

And from the docs:

"What Pylint says is not to be taken as gospel and Pylint isn’t smarter than
you are: it may warn you about things that you have conscientiously done."

https://docs.pylint.org/intro.html#what-pylint-is-not

which has some nice advice for how to deal with pylint so the warnings are
not overwhelming.

I think it is time for me to check it out...


-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26944] android: test_posix fails

2016-05-10 Thread Xavier de Gaye

Xavier de Gaye added the comment:

'id -G' produces the expected result on an android-23-x86 emulator running 
Android 6.0 (API 23).

There is a new error now instead of the one reported at issue #26932:

==
FAIL: test_getgroups (test.test_posix.PosixTester)
--
Traceback (most recent call last):
  File "/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_posix.py", line 
816, in test_getgroups
set(posix.getgroups() + [posix.getegid()]))
AssertionError: Items in the second set but not the first:
0


The problem is that posix.getegid() returns 0, and 0 is not in the list printed 
by 'id -G'.

--
nosy: +Chi Hsuan Yen

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26991] Possible reference leak in MAKE_FUNCTION

2016-05-10 Thread Xiang Zhang

Xiang Zhang added the comment:

I'm willing to. But I don't know where is the suitable place to put such a test 
and since the reference leak only appears in error case, can compile a function 
with annotations in a loop accomplish the test goal?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Steven D'Aprano
Hi Claudiu,


On Tue, 10 May 2016 11:51 pm, 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 that the
> feedback had to come in rather a harsh manner, on this group,
> instead of being reported as a bug or an enhancement on pylint's
> bug tracker.
>
> Anyway, I wanted to tell you that I agree with your opinion
> regarding that message and as such, it is removed and won't be
> emitted anymore in the next release (1.6)

Thanks for being so understanding!

Speaking for myself, I think that the test for filter versus list
comprehensions is a reasonable test to include, so long as it is disabled
by default. Does PyLint support opt-in checks?



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26936] android: test_socket fails

2016-05-10 Thread Xavier de Gaye

Xavier de Gaye added the comment:

testGetaddrinfo does not fail anymore on an emulator running an android-23-x86, 
i.e. Android 6.0 or API 23.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26935] android: test_os fails

2016-05-10 Thread Xavier de Gaye

Xavier de Gaye added the comment:

This is fixed at API 23 (Android 6.0) and test_os runs on an android-23-x86 
emulator without failures.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26925] android: test_multiprocessing_main_handling fails

2016-05-10 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Closing as duplicate of #26924.

--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26992] 64-bit Python 2.7.11 hangs in 64-bit Windows 10 - CMD and Git Bash

2016-05-10 Thread R. David Murray

R. David Murray added the comment:

Is there any way you can attach a debugger to the process and see what it is 
doing or where it is stuck?  Otherwise, unless someone else can reproduce this, 
I don't think there is much we can do with this bug report.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: TypeError: unorderable types: function() < int()

2016-05-10 Thread Steven D'Aprano
On Tue, 10 May 2016 11:47 pm, Chris Angelico wrote:

> On Tue, May 10, 2016 at 11:40 PM, Steven D'Aprano 
> wrote:
>> You are asking the player to hit enter at 10 seconds. *Exactly* ten
>> seconds. The computer can measure time to well under a millionth of a
>> second, I'm pretty sure that nobody, no matter how skillful, can be
>> expected to hit enter after exactly 10.00 seconds, not 10.01 or
>> 9.99 seconds.
>>
> 
> But the times were being calculated at one-second resolution, which
> solves that but raises its own issues.

Ah, I didn't realise that time.strftime("%S") was one-second resolution
(obvious in hindsight, duh!) and the call to time.time() is apparently
unused.



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pylint prefers list comprehension over filter...

2016-05-10 Thread Claudiu Popa
On Sunday, May 8, 2016 at 4:41:02 AM UTC+3, 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 other core 
> developers, and you and feel obligated to follow them.
> 
> They should at least add a disclaimer "Using the default options, pylint 
> checks that your code complies with the pylint-approved subset of Python."
> 
> -- 
> Terry Jan Reedy

Hi,

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 that the
feedback had to come in rather a harsh manner, on this group,
instead of being reported as a bug or an enhancement on pylint's
bug tracker.
Anyway, I wanted to tell you that I agree with your opinion
regarding that message and as such, it is removed and won't be
emitted anymore in the next release (1.6)

Thank you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: TypeError: unorderable types: function() < int()

2016-05-10 Thread Chris Angelico
On Tue, May 10, 2016 at 11:40 PM, Steven D'Aprano  wrote:
> You are asking the player to hit enter at 10 seconds. *Exactly* ten seconds.
> The computer can measure time to well under a millionth of a second, I'm
> pretty sure that nobody, no matter how skillful, can be expected to hit
> enter after exactly 10.00 seconds, not 10.01 or 9.99 seconds.
>

But the times were being calculated at one-second resolution, which
solves that but raises its own issues.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


  1   2   >