Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Steven D'Aprano
On Sat, 07 Jul 2018 11:38:37 +1000, Ben Finney wrote:

> Steven D'Aprano  writes:
> 
>> Somebody gave a quote about dynamic typing, along the lines of
>>
>> "Just because a language allows a lot of dynamic features, doesn't mean
>> people's code uses a lot of dynamism."
> 
> You did refer us to http://lambda-the-ultimate.org/node/1519> on
> this forum. That contains a quote attributed to John Aycock with the
> meaning you paraphrase above.

That's it! You're my hero!

I knew it wasn't *my* quote, I had forgotten that I linked to it.

Thanks.


-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


Re: PEP 526 - var annotations and the spirit of python

2018-07-06 Thread Steven D'Aprano
On Fri, 06 Jul 2018 09:42:09 +0200, Antoon Pardon wrote:

> On 06-07-18 08:17, Steven D'Aprano wrote:
>> On Thu, 05 Jul 2018 16:09:52 +0200, Antoon Pardon wrote:
>>
 This is not an innovation of Mypy. It's how type inference is
 supposed to work. If a particular type checker doesn't do that, it is
 doing it wrong.
>>> That is how type interference works in languages that have some kind
>>> of static typing like Haskell.
>> No, that's how type inference works in dynamically typed languages like
>> Python as well. See Mypy for an example.
> 
> Sorry, but this kind of wording is misleading to me. IMO, it strongly
> suggests that we can have type inference in python without losing any of
> the dynamism.

That's true in two senses, false in a third.

1. We can have the benefits of static type checking without losing 
   any of the *available* dynamism -- the Python interpreter remains
   fully dynamic and we can make use of that dynamism by simply *not*
   type-checking a particular function or module;

2. we can get the benefits of static type checking without losing
   the dynamism we *actually use*, because in general we don't use
   much of it (you don't miss what you don't use);

3. but in the third sense, of course you do have to choose to forgo
   the opportunity for some dynamism in order to get the benefit of
   static type checking.

With gradual typing you can statically check the parts of your code that 
benefit from it while other parts of the code remain fully dynamic.

The bottom line is that every Python programmer can choose for their own 
projects just how much or how little dynamism is appropriate, trading off 
the convenience of runtime dynamic typing with the type-safety of static 
type checking without needing to make an All Or Nothing choice.


> The impression that I got from this thread was that you could just trow
> any python program through mypy and it would work.

Not quite, but you might be surprised. I know I was :-)

I just picked a random selection of modules out of my private toolbox, 
ran mypy over them, and in a few tries found some bugs:

steve@orac ~ $ mypy python/utilities/enhanced_dir.py
python/utilities/enhanced_dir.py:141: error: Module 'types' has no 
attribute 'ClassType'


steve@orac ~ $ mypy python/excguard.py
python/excguard.py:138: error: "str" has no attribute "uper"; maybe 
"upper"?

That's not bad. With absolutely no type hinting, mypy found two bugs in 
my code from six attempts.

And remember, with no type annotations, Mypy is treating all the 
functions as duck-typed, even if I'm not using them in a duck-typed 
fashion. If I were to add annotations, I'd probably find a lot more 
errors. (I don't fool myself into thinking my code is bug-free.)

You aren't going to get the full benefit of Mypy without making a 
commitment to type-hinting at least *some* of your code. Running it over 
a random Python module with no hints is not going to do much.


>> But if you opt-in to using a type-checker, the assumption is that you
>> are writing in a less-dynamic, more-static style that will actually get
>> some advantage from static type checking. If you're not doing so, then
>> you're just annoying yourself and wasting time and you won't enjoy the
>> experience one bit.
> 
> Thank you for this clarification. It seems that we are largely agreeing
> but I seem to have understood your past contributions differently than
> you intended.

I may have been a little unclear, if so mea culpa, sorry for any 
misunderstanding I caused.



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


[issue34058] Default Python 3.7 install broken on openSUSE Leap 42.3: $PYTHONHOME/lib64/python3.7/lib-dynload/ not linked to $PYTHONHOME/lib/python3.7/lib-dynload/

2018-07-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Did you get the source from openSUSE or from python.org?

--

___
Python tracker 

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



Re: about main()

2018-07-06 Thread Gregory Ewing

Robin Becker wrote:
The 
villagers will shout "hey siri I need a compiler" and one will be 
provided


Then one day someone says "Hey, Siri, make me an artificial
intelligence that can respond to voice commands", and then
it's not long before the AIs are breeding by themselves and
take over. Berries are no longer required after that.

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


[issue34056] checked hash-based pyc files not working with imp module

2018-07-06 Thread miss-islington


miss-islington  added the comment:


New changeset 7bd6f0e5500f778e940374237b94651f60ae1990 by Miss Islington (bot) 
in branch '3.7':
closes bpo-34056: Always return bytes from _HackedGetData.get_data(). (GH-8130)
https://github.com/python/cpython/commit/7bd6f0e5500f778e940374237b94651f60ae1990


--
nosy: +miss-islington

___
Python tracker 

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



[issue34056] checked hash-based pyc files not working with imp module

2018-07-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7716

___
Python tracker 

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



[issue34056] checked hash-based pyc files not working with imp module

2018-07-06 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset b0274f2cddd36b49fe5080efbe160277ef546471 by Benjamin Peterson in 
branch 'master':
closes bpo-34056: Always return bytes from _HackedGetData.get_data(). (GH-8130)
https://github.com/python/cpython/commit/b0274f2cddd36b49fe5080efbe160277ef546471


--
resolution:  -> fixed
stage: patch review -> 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



[issue30400] Race condition in shutil.copyfile()

2018-07-06 Thread Preston Moore


Preston Moore  added the comment:

Sure.  I'll get everything up to date for 3.8 and create and required test.

Thanks!

--

___
Python tracker 

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



[issue34058] Default Python 3.7 install broken on openSUSE Leap 42.3: $PYTHONHOME/lib64/python3.7/lib-dynload/ not linked to $PYTHONHOME/lib/python3.7/lib-dynload/

2018-07-06 Thread Ted Kandell


Ted Kandell  added the comment:

This isn't for the OpenSUSE official build itself, just compiling and 
installing from source on OpenSUSE 42.3. Without the symlink, and also with a 
wrong PYTHONHOME, pip coredumps.

--

___
Python tracker 

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



[issue34058] Default Python 3.7 install broken on openSUSE Leap 42.3: $PYTHONHOME/lib64/python3.7/lib-dynload/ not linked to $PYTHONHOME/lib/python3.7/lib-dynload/

2018-07-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

A crash, for the tracker, is failed execution without a Python exception and 
trackback.

Debian, Fedora, Gentoo, RHEL, and Ubuntu (AMD64) buildbots are currently green. 
 We don't have one for SUSE, open or other wise.

If you have not yet reported the issue to openSUSE, I would do so in case this 
is something they should deal with.

Victor, do you have anything to add?

--
nosy: +terry.reedy, vstinner
type: crash -> behavior

___
Python tracker 

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



Re: about main()

2018-07-06 Thread Steven D'Aprano
On Fri, 06 Jul 2018 18:27:16 +, Grant Edwards wrote:

> On 2018-07-06, Gene Heskett  wrote:
> 
>> In that case, I hate to say it, but your education is sorely lacking in
>> the fundamentals. Smelting for instance was discussed at length in the
>> high school physics books I was reading by the time I was in the 3rd
>> grade. Don't they teach anything in school anymore? Tanning leather for
>> instance involves a long soaking in strong tea, and doesn't name the
>> brand or genus of the tea, the important part was the tannic acid
>> content.
> 
> IIRC, oack leaves/chips work well also.

But the *best* quality tanned leather was historically made from dog 
faeces, known as "pure" by the tanners of the time:

Members only:
https://www.vettimes.co.uk/article/a-dirty-job-but-not-to-be-sniffed-at/

But this might work for you:
https://www.vettimes.co.uk/app/uploads/wp-post-to-pdf-enhanced-cache/1/a-dirty-job-but-not-to-be-sniffed-at.pdf



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


[issue34029] tkinter.filedialog.askdirectory() crashing before dialog opens when importing pywinauto

2018-07-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Ryan: this tracker only covers issues with the PSF CPython distribution.  
Problems with 3rd party modules like pywinauto are not our responsibility until 
someone determines that its misbehavior reflects a CPython bug.

--
nosy: +terry.reedy
resolution:  -> third party
status: open -> closed

___
Python tracker 

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



Re: Thread-safe way to add a key to a dict only if it isn't already there?

2018-07-06 Thread Steven D'Aprano
On Sat, 07 Jul 2018 02:51:41 +0900, INADA Naoki wrote:

> D.setdefault('c', None)

Oh that's clever!

Thanks!



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Ben Finney
Steven D'Aprano  writes:

> Somebody gave a quote about dynamic typing, along the lines of
>
> "Just because a language allows a lot of dynamic features, doesn't mean 
> people's code uses a lot of dynamism."

You did refer us to http://lambda-the-ultimate.org/node/1519> on
this forum. That contains a quote attributed to John Aycock with the
meaning you paraphrase above.

-- 
 \“… it's best to confuse only one issue at a time.” —Brian W. |
  `\Kernighan and Dennis M. Ritchie, _The C programming language_, |
_o__) 1988 |
Ben Finney

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


[issue34017] Tkinter CheckButton not working in EXE

2018-07-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The tracker only covers the PSF cpython distribution.  When you code ran in 
Spyder, our responsibily ended.  cx Freeze is a 3rd party package: contact 
their support.

--
nosy: +terry.reedy
resolution:  -> third party
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



[issue34013] Inconsistent SyntaxError for print

2018-07-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Eric, Nick, Serhiy: this issue proposes to extend the print message patch of 
#30597 to cover more cases.  On the face of it, this seems sensible, but I have 
no read the original discussion or the current and proposed patches.

--
nosy: +eric.smith, ncoghlan, serhiy.storchaka, terry.reedy

___
Python tracker 

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



[issue31839] datetime: add method to parse isoformat() output

2018-07-06 Thread Martin Panter


Change by Martin Panter :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> datetime: add ability to parse RFC 3339 dates and times

___
Python tracker 

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



[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2018-07-06 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset e25399b40cd15620e77c9ad2ed24549006ae9b47 by INADA Naoki in branch 
'master':
bpo-23493: json: Change sort_keys in Python encoder same to C (GH-8131)
https://github.com/python/cpython/commit/e25399b40cd15620e77c9ad2ed24549006ae9b47


--

___
Python tracker 

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



[issue34019] webbrowser: wrong arguments for Opera browser.

2018-07-06 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 8902a1d14e9fe6fb80f4145ad4ea27a579567289 by Pablo Galindo in 
branch '2.7':
[2.7] bpo-34019: Fix wrong arguments for Opera Browser (GH-8047) (#8126)
https://github.com/python/cpython/commit/8902a1d14e9fe6fb80f4145ad4ea27a579567289


--

___
Python tracker 

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



[issue34063] binhex REASONABLY_LARGE = 32768 so what is 128000

2018-07-06 Thread Jim Jewett


New submission from Jim Jewett :

binhex defines a module-wide constant of 

REASONABLY_LARGE = 32768  # Minimal amount we pass the rle-coder

Later on, in 5 locations it does either ifp.read(128000) or 
ifp.read_rsrc(128000)

It isn't clear why a different constant is used, let alone why a literal is 
used instead of something like REASONABLY_LARGE.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 321193
nosy: Jim.Jewett, docs@python
priority: low
severity: normal
stage: needs patch
status: open
title: binhex REASONABLY_LARGE = 32768 so what is 128000
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue34057] Py_Initialize aborts when using static Python version. Windows

2018-07-06 Thread Alberto


Alberto  added the comment:

Hey Victor,

I've spent another number of hours debugging the problem and trying to avoid 
encodings to be loaded but I've had no luck since initfsencoding is necesary 
for init_sys_streams to work and that's an important function that sets stdin, 
stout and sterr. 

It seems that encodings is the only thing that prevents Py_Initialize to be 
called and therefore for a static python version to be used.

Is there any way to move encodings to pythoncore? Is there any other solution? 
I'm happy to put my time on this (I've already spent 3 full days debugging the 
problem).

I think this could be considered a bug since there is no point on statically 
build python and use it as a library as the README stands if there is still 
requirements on encodings which need to reside on the filesystem. 

Thank you again for your time

--

___
Python tracker 

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



Re: about main()

2018-07-06 Thread Jim Lee



On 07/06/18 12:57, Terry Reedy wrote:

On 7/5/2018 9:40 PM, Jim Lee wrote:


On 07/05/18 18:25, Steven D'Aprano wrote:

On Thu, 05 Jul 2018 11:27:09 -0700, Jim Lee wrote:


Take a village of people.  They live mostly on wild berries.

Because of course a community of people living on one food is so
realistic. Even the Eskimos and Inuit, living in some of the harshest
environments on earth, managed to have a relatively wide variety of 
foods

in their diet.

https://en.wikipedia.org/wiki/Inuit_cuisine


Pedantics again.  Didn't even get the point before tearing apart the 
*analogy* rather than the *point itself*.


The irony of both Steven's interruption and your reaction is that the 
Inuit story somewhat supports your point:


"There has been a decline of hunting partially due to the fact that 
young people lack the skills to survive off the land. "


-- because they are 'growing more accustomed to the Qallunaat ("white 
people") food that they receive from the south.'


If 'white people' food stopped coming, they would starve where they are.

But change scenarios that assume that everything else remains the same 
are flawed.  Maintaining traditional skills comes up in every culture 
that is changing, which now is most all.  But the same dynamism tends 
to generate new solutions where needed.





Finally, a person with sense enough to contribute a rational thought to 
this thread!



>"But the same dynamism tends to generate new solutions where needed."

Yes.  However,  technological evolution happens at a blindingly faster 
rate than cultural evolution.  Because of this, there are many of us 
still alive who have been here "from the beginning" of the computer era.


That gives us a unique perspective, in that we have seen first-hand many 
cycles of these "solutions" being invented, re-invented, and 
re-re-invented.  We lament the continual re-emergence of bad ideas that 
have failed in the past (and applaud the good ones).


People like that, in a cultural context, are treated as wise elders;  in 
the technology context, they're treated as doddering old fools.


Somehow, we've adopted the notion that old == obsolete == useless when 
it comes to technological ideas.  I've seen more than one person refuse 
to consider some software application (even though it fit their 
requirements perfectly) simply because it hadn't been updated in 9 
months.  That's too "old".  You'd think they were shopping for a gallon 
of milk.



-Jim

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


Re: about main()

2018-07-06 Thread Grant Edwards
On 2018-07-06, Jim Lee  wrote:
> On 07/06/18 11:25, Grant Edwards wrote:
>> On 2018-07-06, Jim Lee  wrote:
>>
>>> Pedantics again. Didn't even get the point before tearing apart the
>>> *analogy* rather than the *point itself*.
>> Jim Lee, this is the Internet.
>>
>> Intenet, this is Jim Lee.
>>
>> :)
>
> You have an inaccurate anthropomorphic reference as well as a
> spelling error.
>
> [insert long diatribe on how Python annotations are God's gift to mankind]
>
> There.  Do I fit in now?

Yes, brilliantly!

-- 
Grant Edwards   grant.b.edwardsYow! I'm having an
  at   emotional outburst!!
  gmail.com

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


[issue34034] Python 3.7.0 multiprocessing forkserver ForkingPickler behaviour change

2018-07-06 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

No problem! I'm going to close this issue as I don't think there's anything we 
can do here.

--
resolution:  -> not a bug
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



Re: about main()

2018-07-06 Thread Terry Reedy

On 7/5/2018 9:40 PM, Jim Lee wrote:


On 07/05/18 18:25, Steven D'Aprano wrote:

On Thu, 05 Jul 2018 11:27:09 -0700, Jim Lee wrote:


Take a village of people.  They live mostly on wild berries.

Because of course a community of people living on one food is so
realistic. Even the Eskimos and Inuit, living in some of the harshest
environments on earth, managed to have a relatively wide variety of foods
in their diet.

https://en.wikipedia.org/wiki/Inuit_cuisine


Pedantics again.  Didn't even get the point before tearing apart the 
*analogy* rather than the *point itself*.


The irony of both Steven's interruption and your reaction is that the 
Inuit story somewhat supports your point:


"There has been a decline of hunting partially due to the fact that 
young people lack the skills to survive off the land. "


-- because they are 'growing more accustomed to the Qallunaat ("white 
people") food that they receive from the south.'


If 'white people' food stopped coming, they would starve where they are.

But change scenarios that assume that everything else remains the same 
are flawed.  Maintaining traditional skills comes up in every culture 
that is changing, which now is most all.  But the same dynamism tends to 
generate new solutions where needed.


--
Terry Jan Reedy


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


[issue34034] Python 3.7.0 multiprocessing forkserver ForkingPickler behaviour change

2018-07-06 Thread Santiago Hernandez


Santiago Hernandez  added the comment:

Thanks, I get it now, I hadn't seen that the pickling of the workers was
Processes pickling.
Yeah, I was not doing this anywhere else, it seems like slipped through
once. But it called my attention that it used to work and now it doesn't.

On Tue, Jul 3, 2018 at 4:38 PM, Antoine Pitrou 
wrote:

>
> Antoine Pitrou  added the comment:
>
> It could be many different things.  The bottom line here, though, is that
> the Process class is not designed to be picklable (how would it work?),
> which is probably why you're seeing this.
>
> --
> nosy: +pitrou
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue34062] Python launcher on Windows does not work with --list or --list-paths

2018-07-06 Thread Eryk Sun


Eryk Sun  added the comment:

I don't think the launcher has unit tests.

The if statement in process() that calls show_python_list only checks for "-0". 
It needs to check for the long names as well, e.g.:

if (argc == 2) {
/* First check for -0[p], --list, or --list-paths. */
if (!wcsncmp(p, L"-0", 2) || !wcscmp(p, L"--list") ||
!wcscmp(p, L"--list-paths")) {
valid = show_python_list(argv);
}
}

show_python_list shouldn't need to be modified. It already looks for -0p and 
--list-paths to include paths in the output format.

--
nosy: +eryksun

___
Python tracker 

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



Re: about main()

2018-07-06 Thread Jim Lee



On 07/06/18 11:25, Grant Edwards wrote:

On 2018-07-06, Jim Lee  wrote:

Pedantics again. Didn't even get the point before tearing apart the
*analogy* rather than the *point itself*.

Jim Lee, this is the Internet.

Intenet, this is Jim Lee.

:)



You have an inaccurate anthropomorphic reference as well as a spelling 
error.


[insert long diatribe on how Python annotations are God's gift to mankind]

There.  Do I fit in now?

:)

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


[issue34059] multiprocessing deadlock

2018-07-06 Thread Guillaume Perrault-Archambault


Guillaume Perrault-Archambault  added the comment:

A friend of mine has suggested a fix that seems to work for now (upgrade numpy 
from 1.14.3 to 1.14.5). This makes no sense at all but it does seem to work for 
now. I have a strong suspicion that this is just masking the problem and that 
it will reappear.

However, since it works I would not want you to waste any time on this. I will 
reopen if the deadlock reappears!

I do apologize if you already spent a lot of time on this.

Regards,
Guillaume

--
resolution:  -> third party
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



Re: about main()

2018-07-06 Thread Grant Edwards
On 2018-07-06, Jim Lee  wrote:
>
> Pedantics again. Didn't even get the point before tearing apart the
> *analogy* rather than the *point itself*.

Jim Lee, this is the Internet.

Intenet, this is Jim Lee.

:)

-- 
Grant Edwards   grant.b.edwardsYow! I'm encased in the
  at   lining of a pure pork
  gmail.comsausage!!

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


[issue33922] [Windows] Document the launcher's -64 suffix

2018-07-06 Thread Eryk Sun


Change by Eryk Sun :


--
assignee:  -> docs@python
components: +Documentation
dependencies: +Allow windows launcher to specify bit lengths with & without 
minor version
nosy: +docs@python
resolution: duplicate -> 
stage: resolved -> patch review
status: closed -> open
superseder: Allow windows launcher to specify bit lengths with & without minor 
version -> 
title: Enforce 64bit Python by Launcher -> [Windows] Document the launcher's 
-64 suffix
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



Re: about main()

2018-07-06 Thread Grant Edwards
On 2018-07-06, Gene Heskett  wrote:

> In that case, I hate to say it, but your education is sorely lacking in 
> the fundamentals. Smelting for instance was discussed at length in the 
> high school physics books I was reading by the time I was in the 3rd 
> grade. Don't they teach anything in school anymore? Tanning leather for 
> instance involves a long soaking in strong tea, and doesn't name the 
> brand or genus of the tea, the important part was the tannic acid 
> content.

IIRC, oack leaves/chips work well also.

-- 
Grant Edwards   grant.b.edwardsYow! I'm shaving!!
  at   I'M SHAVING!!
  gmail.com

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


Re: about main()

2018-07-06 Thread Grant Edwards
On 2018-07-05, Jim Lee  wrote:

> Take a village of people. They live mostly on wild berries. 

It's completely orthogonal to your point of course, but I thought
villages happened precisely because people had stopped living off wild
stuff and had adopted organized agriculture...

-- 
Grant Edwards   grant.b.edwardsYow! Are you still an
  at   ALCOHOLIC?
  gmail.com

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


[issue34062] Python launcher on Windows does not work with --list or --list-paths

2018-07-06 Thread Brett Cannon


New submission from Brett Cannon :

When you run `py -h` it says you can use -0 or --list as well as -0p or 
--list-paths, but both --list and --list-paths don't work (the -0-based options 
do, though).

--
components: Windows
messages: 321187
nosy: brett.cannon, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: test needed
status: open
title: Python launcher on Windows does not work with --list or --list-paths
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



Re: Thread-safe way to add a key to a dict only if it isn't already there?

2018-07-06 Thread INADA Naoki
D.setdefault('c', None)
On Sat, Jul 7, 2018 at 2:49 AM Steven D'Aprano
 wrote:
>
> I have a dict with string keys:
>
> D = {'a': None, 'b': None}
>
> (the values don't matter for this question) and I want to add a key but
> only if it isn't already there. If I do the obvious:
>
> if not 'c' in D:
> D['c'] = None
>
> there's a Time Of Check to Time Of Use bug where some other thread could
> conceivably insert 'c' into the dict between the check and the insertion.
>
> How do I do a thread-safe insertion if, and only if, the key isn't
> already there?
>
>
>
> Thanks in advance,
>
>
>
> --
> Steven D'Aprano
> "Ever since I learned about confirmation bias, I've been seeing
> it everywhere." -- Jon Ronson
>
> --
> https://mail.python.org/mailman/listinfo/python-list



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


Thread-safe way to add a key to a dict only if it isn't already there?

2018-07-06 Thread Steven D'Aprano
I have a dict with string keys:

D = {'a': None, 'b': None}

(the values don't matter for this question) and I want to add a key but 
only if it isn't already there. If I do the obvious:

if not 'c' in D:
D['c'] = None

there's a Time Of Check to Time Of Use bug where some other thread could 
conceivably insert 'c' into the dict between the check and the insertion.

How do I do a thread-safe insertion if, and only if, the key isn't 
already there?



Thanks in advance,



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


[issue32521] NIS module fails to build due to the removal of interfaces related to Sun RPC from glibc.

2018-07-06 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

On Fedora after the fix we had also to BuildRequire libnsl2-devel and 
libtirpc-devel after the glibc change was implemented for the correct headers 
to be included within the buildroot.

I am not familiar with suse's build system webui to find the logs, but are 
those packages provided by the distribution?

--

___
Python tracker 

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



Re: testing code

2018-07-06 Thread Sharan Basappa
On Friday, 6 July 2018 09:22:31 UTC+5:30, Chris Angelico  wrote:
> On Fri, Jul 6, 2018 at 12:56 PM, Sharan Basappa
>  wrote:
> > Please let me know if the following understanding of mine is correct.
> > I need to put the program code in a separate file and organize every 
> > executable code in some form of function. If any code exists outside of 
> > function then it is not executable by importing.
> >
> 
> Kinda. It's actually the other way around: if any code exists outside
> of functions, it will be executed immediately when you import. So
> you're correct in that it would be hard (maybe impossible) to
> unit-test that; and yes, the normal way to do it is to put all your
> important code into functions.
> 
> ChrisA

thanks a lot
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: testing code

2018-07-06 Thread Sharan Basappa
On Friday, 6 July 2018 09:32:08 UTC+5:30, Cameron Simpson  wrote:
> On 05Jul2018 19:56, Sharan Basappa  wrote:
> >I have implemented my first program in python that uses ML to do some 
> >classification task. The whole code is in a single file currently.
> >It contains executable code as well as functions.
> 
> I presume when you write "executable code" you mean some kind of "main 
> program" 
> that just runs when you run the .py file?
> 
> >At the end of the program, I have series of calls that is used to test my 
> >code.
> >Now, I would like to re-structure this to separate test code from the 
> >program.
> >As I have not done this in Python, I am a bit lost.
> >
> >Please let me know if the following understanding of mine is correct.
> >I need to put the program code in a separate file and organize every 
> >executable code in some form of function. If any code exists outside of 
> >function then it is not executable by importing.
> 
> This is not quite right. Because Python is a dynamic language, importing a 
> file 
> actually runs it. That is how the functions etc get defined.
> 
> So what you need to do is arrange that your "series of calls that is used to 
> test my code" live in their own function, and that that function only gets 
> run 
> if the file is directly run.
> 
> Fortunately, this is a very common, almost universal, requirement and there 
> is 
> a standard idom for arranging it.
> 
> Support you have your code in the file "foo.py" (because I need a concrete 
> filename for the example). It might look like this at present:
> 
>   def func1(...):
> 
>   def func2(...):
> 
>   x = func1(...)
>   y = func2(...)
>   print(x + y)
> 
> i.e. some function definitions and then you testing code.
> 
> Now, you can write another file "foo_tests.py" which starts like this:
> 
>   import foo
>   ... run some tests of foo.func1, foo.func2 etc ...
> 
> The issue is that as written, foo.py will run your test calls during the 
> import.  Restructure foo.py like this:
> 
>   def main():
>   x = func1(...)
>   y = func2(...)
>   print(x + y)
> 
>   def func1(...):
> 
>   def func2(...):
> 
>   if __name__ == '__main__':
>   main()
> 
> This is very standard. When you run a python file directly the built in  
> __name__ variable contains the string "__main__". This tells you that you're 
> running it as a "main program" i.e. directly.
> 
> If you import the file instead, as from your planned testing file, the 
> __name__ 
> variable will contain the string "foo" because that is the name of the module.
> 
> So that "main" function and the "if" at the bottom is standard Python 
> boilerplate code for what you're trying to do.
> 
> >Import this in my test program (file/module) and then initiate  calls 
> >present 
> >in the program.
> >If there is some simple example, it would help a lot.
> 
> Now you can do this part.
> 
> Cheers,
> Cameron Simpson 

Cameron.

thanks. this is much more easier than I thought.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34059] multiprocessing deadlock

2018-07-06 Thread Guillaume Perrault-Archambault


Guillaume Perrault-Archambault  added the comment:

Hi Victor and Yang,

Thanks for your fast replies.

I did initially think it could be a torch issue. Indeed, I have an
equivalent numpy testcase that does not deadlock. However, the fact that it
gets stuck inside a multiprocessing wait statement makes me think it's
still a multiprocessing issue.

I've spent two weeks full time on this issue. Over at torch forums I've had
no replies (
https://discuss.pytorch.org/t/multiprocessing-code-works-using-numpy-but-deadlocked-using-pytorch/20473
).

On stackexchange I only got a workaround suggestion that works sporadically
(
https://stackoverflow.com/questions/51093970/multiprocessing-code-works-using-numpy-but-deadlocked-using-pytorch).
Basically I can get rid of the deadlock (sometimes) if I impose only one
thread per process. But this is not a solution anyway.

I have tried stepping through the code, but because it is multiprocessed,
you cannot step through it (at least not in the conventional way, since the
main thread is not doing the heavy lifting).

I've tried adding print statements in the multiprocess library and mucking
around with it a bit, but debugging multi-processed code in this way is an
absolute nightmare because you can't even trust the order in which print
statements display on the screen. And probably more relevant, I'm out of my
league here.

I'm really at a complete dead end. I'm blocked and my work cannot progress
without fixing this issue. I'd be very grateful if you could try to
reproduce and rule out the multiprocessing library. If you need help
reproducing I can send a different testcase that deadlocked on my friend's
Mac (for him, the original testcase did not deadlock).

Testcase I attached in my original post it sometimes deadlocks and
sometimes doesn't, depending on the machine I run on. So I'm not suprised
you got no deadlock when you tried to reproduce.

I can always get it deadlocking on Linux/Mac though, by tweaking the code.

To give you a sense of how unreliably it deadlocks, just removing the for
loop in the code (which is outside the multiprocessing portion of the
code!) somehow gets rid of the deadlock. Also, it never deadlocks on
Windows.

If you could provide any help on this issue I'd be very grateful.

Regards,
Guillaume.

On Fri, Jul 6, 2018 at 11:21 AM STINNER Victor 
wrote:

>
> STINNER Victor  added the comment:
>
> IMHO it's an issue with your usage of the torch module which is not part
> of the Python stdlib, so I suggest to close this issue as "third party" or
> "not a bug".
>
> --
> nosy: +vstinner
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue34061] Document sqlite3.NotSupportedError exception

2018-07-06 Thread Berker Peksag


New submission from Berker Peksag :

Most of the exceptions in sqlite3 module were documented in issue 6057 
(https://github.com/python/cpython/commit/ed789f9cf9586d94e85115bb516a2ab6b9a2f668)

Unfortunately, I noticed that I missed NotSupportedError while reviewing PR 
8086. I think it should be documented in the Exceptions section as well:

https://docs.python.org/3.8/library/sqlite3.html#exceptions

We can adapt the text in PEP 249:

https://www.python.org/dev/peps/pep-0249/#notsupportederror

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 321184
nosy: berker.peksag, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: Document sqlite3.NotSupportedError exception
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34041] add *deterministic* parameter to sqlite3.Connection.create_function()

2018-07-06 Thread Berker Peksag


Change by Berker Peksag :


--
versions: +Python 3.8

___
Python tracker 

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



[issue34042] Reference loss for local classes

2018-07-06 Thread Yury Selivanov


Yury Selivanov  added the comment:

Thank you for reporting the issue, Kay.  And huge thanks to Antoine and Pablo 
for bisecting.

--
resolution:  -> fixed
stage: patch review -> 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



[issue34042] Reference loss for local classes

2018-07-06 Thread miss-islington


miss-islington  added the comment:


New changeset 127bd9bfd591c8ec1a97eb7f4037c8b884eef973 by Miss Islington (bot) 
in branch '3.7':
bpo-34042: Fix dict.copy() to maintain correct total refcount (GH-8119)
https://github.com/python/cpython/commit/127bd9bfd591c8ec1a97eb7f4037c8b884eef973


--
nosy: +miss-islington

___
Python tracker 

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



[issue34057] Py_Initialize aborts when using static Python version. Windows

2018-07-06 Thread Alberto

Alberto  added the comment:

Hi,

First of all thank you for your answer.
If every module can't be statically compiled within a library, what is the
point of having instructions to compile python statically in the build
instructions?

Can I modify the code to make it completely statically?

Thank you

On Fri, Jul 6, 2018 at 12:27 AM STINNER Victor 
wrote:

>
> STINNER Victor  added the comment:
>
> > Why is Python looking for external modules when it is a statically
> linked library and encodings should be built-in?
>
> Hi, this is not a bug. Python needs its standard library. You might want
> to put the whole stdlib into a single ZIP, but I don't recall how to do
> that.
>
> The encodings and codecs modules are not built-in, but _codecs is built-in:
>
> >>> import encodings, codecs, _codecs
> >>> encodings
> 
> >>> codecs
> 
> >>> _codecs
> 
>
> I suggest to close this issue as "not a bug". You should ask on a Python
> mailing list or forum to get help how to build a standalone Python.
>
> --
>
> ___
> Python tracker 
> 
> ___
>
-- 
Alberto García Illera

GPG Public Key: https://goo.gl/twKUUv

--

___
Python tracker 

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



[issue34032] Add platlibdir to allow distinction between /usr/lib and /usr/lib64 for Linux

2018-07-06 Thread Éric Araujo

Éric Araujo  added the comment:

I think there are open tickets discussing this, and the problem is more complex 
that a simple PR:

- Debian does multiarch that’s more than just lib/lib64
- some systems have lib32 I think
- recent systems merge / and /usr, is that relevant?
- how does virtualenv follow or customize install schemes
- doko patches Python in Debian and Ubuntu to edit sysconfig/distutils

--
nosy: +doko, eric.araujo

___
Python tracker 

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



[issue34042] Reference loss for local classes

2018-07-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7715

___
Python tracker 

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



[issue34042] Reference loss for local classes

2018-07-06 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 0b75228700e0077d8bf2636e74733389514b4b2f by Yury Selivanov in 
branch 'master':
bpo-34042: Fix dict.copy() to maintain correct total refcount (GH-8119)
https://github.com/python/cpython/commit/0b75228700e0077d8bf2636e74733389514b4b2f


--

___
Python tracker 

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



Django-hotsauce 0.9.5 (Realistic Scenario) and libschevo 4.0.2 are out!

2018-07-06 Thread Etienne Robillard

Hi everyone,

I'm really happy to announce the public release of Django-hotsauce 0.9.5 
(Realistic Scenario) and libschevo 4.0.2 for Python! :-)


Downloads:

PyPi

https://pypi.org/project/Django-hotsauce/
https://pypi.org/project/libschevo/

Master site

https://www.isotopesoftware.ca/pub/django-hotsauce/django-hotsauce-0.9.5.tar.gz
https://www.isotopesoftware.ca/pub/libschevo/libschevo-4.0.2.tar.gz

Release notes:

- Maintenance bugfixes (django-hotsauce)
- Fixed several critical issues with transaction management and schema 
migration for the ZODB backend (libschevo)


Have fun!!

Etienne

--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/
--
https://mail.python.org/mailman/listinfo/python-list


[issue34042] Reference loss for local classes

2018-07-06 Thread Yury Selivanov


Yury Selivanov  added the comment:

> If you could do what you often you, and make this what distributions like 
> Debian pull from, it would be good enough in terms of release for me, as it 
> blocks Nuitka tests from passing on them.

I'm not sure what you mean by "what you often do". I'll push a fix to master 
and 3.7 branches in a few minutes, so perhaps you can open a PR to ask Linux 
vendors to add a patch for 3.7.0 to their packages.  An easier solution would 
be for you to disable refcounting tests that rely on gettotalrefcount just for 
3.7.0.  And I apologize for the hassle :(

--

___
Python tracker 

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



[issue34060] regrtest: log "CPU usage" on Windows

2018-07-06 Thread STINNER Victor


New submission from STINNER Victor :

I would help to debug race conditions on Windows to log the "CPU usage" on 
regrtest, as we do on other platforms (using os.getloadavg()).

Links:

* https://stackoverflow.com/questions/13666458/python-collect-system-stats
* 
https://docs.microsoft.com/en-us/windows/desktop/api/pdh/nf-pdh-pdhmakecounterpatha
* GetSystemTimes()?
* 
https://stackoverflow.com/questions/23143693/retrieving-cpu-load-percent-total-in-windows-with-c

--
components: Tests, Windows
messages: 321177
nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: regrtest: log "CPU usage" on Windows
versions: Python 3.8

___
Python tracker 

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



[issue34054] multiprocessing should use time.monotonic() for timeout

2018-07-06 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> 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



[issue34059] multiprocessing deadlock

2018-07-06 Thread STINNER Victor


STINNER Victor  added the comment:

IMHO it's an issue with your usage of the torch module which is not part of the 
Python stdlib, so I suggest to close this issue as "third party" or "not a bug".

--
nosy: +vstinner

___
Python tracker 

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



[issue34059] multiprocessing deadlock

2018-07-06 Thread Windson Yang


Windson Yang  added the comment:

I'm can't reproduce the deadlock, maybe it's related to torch package? Can you 
try without torch to see if this happens again?

--
nosy: +Windson Yang

___
Python tracker 

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



Re: about main()

2018-07-06 Thread Robin Becker

On 05/07/2018 21:43, Jim Lee wrote:

...

identifying the poisonous berries.


I would respect your analogy more if every compiler used today were
forty years old and not being developed by anyone other than its
original creator(s).

ChrisA


It's not about compilers - it's about skills.  As programming becomes more and more specialized, it becomes harder and harder to 
find programmers with a skill set broad enough to be adaptable to a different task.


-Jim

I suspect compiler writing is a task that an AI could be taught. The villagers will shout "hey siri I need a compiler" and one 
will be provided, of course by that time they will all have forgotten about eating berries in favour of soma or equivalent.

--
Robin Becker

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


ANN: Pandas 0.23.2 Released

2018-07-06 Thread Tom Augspurger
Hi all,

I'm happy to announce pandas that pandas 0.23.2 has been released.

This is a minor bug-fix release in the 0.23.x series and includes some
regression fixes, bug fixes, and performance improvements. We recommend
that all users upgrade to this version.
See the full whatsnew
 for a
list of all the changes.

The release can be installed with conda from the default channel and
conda-forge::

conda install pandas

Or via PyPI:

python -m pip install --upgrade pandas

A total of 17 people contributed to this release. People with a “+” by
their names contributed a patch for the first time.

   - David Krych
   - Jacopo Rota +
   - Jeff Reback
   - Jeremy Schendel
   - Joris Van den Bossche
   - Kalyan Gokhale
   - Matthew Roeschke
   - Michael Odintsov +
   - Ming Li
   - Pietro Battiston
   - Tom Augspurger
   - Uddeshya Singh
   - Vu Le +
   - alimcmaster1 +
   - david-liu-brattle-1 +
   - gfyoung
   - jbrockmendel
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Steven D'Aprano
On Fri, 06 Jul 2018 14:02:28 +0100, Bart wrote:

> On 06/07/2018 13:43, Steven D'Aprano wrote:
>> I think it might have been on this list, or possibly one of
>> Python-Ideas or Python-Dev.
>> 
>> Somebody gave a quote about dynamic typing, along the lines of
>> 
>> "Just because a language allows a lot of dynamic features, doesn't mean
>> people's code uses a lot of dynamism."
>> 
>> Does anyone remember this? My google-fu is failing me.
> 
> Wasn't that you? 

No -- I have frequently expressed similar sentiments, but it wasn't mine.


-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


[issue29750] smtplib doesn't handle unicode passwords

2018-07-06 Thread Tal Einat


Tal Einat  added the comment:

I have worked on this, almost ready for a PR.

--

___
Python tracker 

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



[issue32007] nis module fails to build against glibc-2.26

2018-07-06 Thread Matej Cepl


Matej Cepl  added the comment:

> - I agree with Benjamin, let's deprecate the NIS module. NIS/YP functionality 
> has been replaced by NSS a long time ago.

Agree. a) who will separate its functionality into separate module for PyPI, b) 
who start a thread on python-devel?

--

___
Python tracker 

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



[issue29750] smtplib doesn't handle unicode passwords

2018-07-06 Thread Gabriele Tornetta


Gabriele Tornetta  added the comment:

Are there any PRs already for this issue? I couldn't find any on GitHub. Also, 
is the plan to branch the fix down to at least 3.6?

--
nosy: +Gabriele Tornetta

___
Python tracker 

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



Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Bart

On 06/07/2018 13:43, Steven D'Aprano wrote:

I think it might have been on this list, or possibly one of Python-Ideas
or Python-Dev.

Somebody gave a quote about dynamic typing, along the lines of

"Just because a language allows a lot of dynamic features, doesn't mean
people's code uses a lot of dynamism."

Does anyone remember this? My google-fu is failing me.


Wasn't that you? As in this quote in the PEP 526 thread, 5th July 03:01 BST:


> But we know (as so many people keep reminding us) that just because
> Python is extremely dynamic, that doesn't necessarily mean that we use it
> in extremely dynamic ways. Most of the time, say, 95% of the time, if x
> is an int *here*, it is intended to *stay* an int all the way through the
> lifetime of that variable.

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


Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Steven D'Aprano
I think it might have been on this list, or possibly one of Python-Ideas 
or Python-Dev.

Somebody gave a quote about dynamic typing, along the lines of

"Just because a language allows a lot of dynamic features, doesn't mean 
people's code uses a lot of dynamism."

Does anyone remember this? My google-fu is failing me.



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-06 Thread Mark via Python-list
On Friday, July 6, 2018 at 1:22:46 PM UTC+1, Bev in TX wrote:
> > On Jul 6, 2018, at 3:14 AM, Mark via Python-list  
> > wrote:
> > 
> > In the end I changed to a completely different approach.
> > 
> > I now have two parallel directories, one with PySide-based code and the 
> > other with auto-generated PyQt-based code. And I created a tiny script to 
> > copy the PySide code to the PyQt directory & do the necessary changes. (I 
> > can post the script if anyone's interested.)
> 
> I am interested.
> > 
> > This means that there are no import hacks and no (manual) duplication, 
> > while still being easy to test using either binding library.
> > -- 
> > https://mail.python.org/mailman/listinfo/python-list
> 
> Bev in TX

OK, here're the details. Note that the paths are hard-coded (but could easily 
be configurable using argparse).

I assume: (1) the source dir is 'app'; (2) the dest dir is 'app-pyqt'; (3) 
there is a file called app/Uniform.py with this content:

#!/usr/bin/env python3
# Uniform.py
import PySide2.QtCore
from PySide2.shiboken2 import isValid as isObjectAlive
VERSION_STR = (f'PySide2 {PySide2.__version__} / '
   f'Qt {PySide2.QtCore.__version__}')


I then run pyside2pyqt.py in the dir *above* app and app-pyqt:

#!/usr/bin/env python3

import contextlib
import os
import shutil

SRC = 'app'
DST = 'app-pyqt'
UNIFORM_FILE = 'Uniform.py'

def main():
with contextlib.suppress(FileNotFoundError):
shutil.rmtree(DST)
shutil.copytree(SRC, DST, ignore=shutil.ignore_patterns(
'__pycache__', UNIFORM_FILE))
for root, _, files in os.walk(DST):
for name in files:
if name.endswith(('.py', '.pyw')):
filename = os.path.join(root, name)
with open(filename, 'rt', encoding='utf-8') as file:
text = file.read().replace('PySide2', 'PyQt5')
with open(filename, 'wt', encoding='utf-8') as file:
for line in text.splitlines():
if 'pyside2pyqt: DELETE' not in line:
print(line, file=file)
with open(os.path.join(DST, UNIFORM_FILE), 'wt',
  encoding='utf-8') as file:
file.write(UNIFORM)

UNIFORM = '''#!/usr/bin/env python3
import PyQt5.QtCore
import PyQt5.sip
VERSION_STR = (f'PyQt5 {PyQt5.QtCore.PYQT_VERSION_STR} / '
   f'Qt {PyQt5.QtCore.QT_VERSION_STR}')
def isObjectAlive(obj):
return not PyQt5.sip.isdeleted(obj)
'''

if __name__ == '__main__':
main()

The reaons for being able to delete lines is that the APIs aren't identical. 
For example, PySide2's QStyleHints has a setCursorFlashTime() method; but 
PyQt5's doesn't. So for any lines you don't want copied just add the comment, 
e.g.:

style_hints = self.styleHints()   # pyside2pyqt: DELETE
style_hints.setCursorFlashTime(0) # pyside2pyqt: DELETE

I'm sure someone could come up with a more generalized script, but this is 
sufficient for my needs.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2018-07-06 Thread INADA Naoki


INADA Naoki  added the comment:

I can't confirm significant performance benefit.
sort_keys is not bottleneck of pure Python encoder.

BTW, benefit from C encoder is more significant.  It's about 3x faster.
Adding `indent` option support to C encoder may be good target for new 
contributors who want to write C.

--
resolution:  -> rejected
stage: patch review -> 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



Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-06 Thread Bev in TX



> On Jul 6, 2018, at 3:14 AM, Mark via Python-list  
> wrote:
> 
> In the end I changed to a completely different approach.
> 
> I now have two parallel directories, one with PySide-based code and the other 
> with auto-generated PyQt-based code. And I created a tiny script to copy the 
> PySide code to the PyQt directory & do the necessary changes. (I can post the 
> script if anyone's interested.)

I am interested.
> 
> This means that there are no import hacks and no (manual) duplication, while 
> still being easy to test using either binding library.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Bev in TX




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


Re: about main()

2018-07-06 Thread Mark Lawrence

On 06/07/18 07:04, Gregory Ewing wrote:

Steven D'Aprano wrote:
Even the Eskimos and Inuit, living in some of the harshest 
environments on earth, managed to have a relatively wide variety of 
foods in their diet.


They might be living on a very wide variety of berries.

Or perhaps, in their language, "berry" simply means "food".



IIRC their language didn't have a word for "toothache" owing to their 
diet and the use of their teeth as tools.  Or was that a precursor of 
fake news, an urban myth?


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: about main()

2018-07-06 Thread Mark Lawrence

On 06/07/18 02:40, Jim Lee wrote:



On 07/05/18 18:25, Steven D'Aprano wrote:

On Thu, 05 Jul 2018 11:27:09 -0700, Jim Lee wrote:


Take a village of people.  They live mostly on wild berries.

Because of course a community of people living on one food is so
realistic. Even the Eskimos and Inuit, living in some of the harshest
environments on earth, managed to have a relatively wide variety of foods
in their diet.

https://en.wikipedia.org/wiki/Inuit_cuisine


Pedantics again.  Didn't even get the point before tearing apart the 
*analogy* rather than the *point itself*.  Childish. The rest was TL;DR.


-Jim



Welcome to an exclusive club, my dream team.  Congratulations :)

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


[issue34054] multiprocessing should use time.monotonic() for timeout

2018-07-06 Thread miss-islington


miss-islington  added the comment:


New changeset 972458a4245afb4e934fbcb9c0224b105fb5d7ba by Miss Islington (bot) 
in branch '3.6':
bpo-34054: multiprocessing uses time.monotonic() (GH-8118)
https://github.com/python/cpython/commit/972458a4245afb4e934fbcb9c0224b105fb5d7ba


--

___
Python tracker 

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



[issue34054] multiprocessing should use time.monotonic() for timeout

2018-07-06 Thread miss-islington


miss-islington  added the comment:


New changeset 4bd5fce27d5c03a013e5ebb008670ca0d89e3298 by Miss Islington (bot) 
in branch '3.7':
bpo-34054: multiprocessing uses time.monotonic() (GH-8118)
https://github.com/python/cpython/commit/4bd5fce27d5c03a013e5ebb008670ca0d89e3298


--
nosy: +miss-islington

___
Python tracker 

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



PyDev 6.4.3 Released

2018-07-06 Thread Fabio Zadrozny
*PyDev 6.4.3 Release Highlights*

PyDev changes:

   -

   *Debugger*
   - Notification of threads is done as they're created instead of
  synchronized afterwards.
  - Support for using frame evaluation disabled by default as it made
  the debugger much slower on some cases.
  - Fixed case where breakpoint was missed if an exception was raised
  in a given line.
  - Properly break on unhandled exceptions on threads.
  - Add missing import which affected repl with IPython.
  - Fix for case where breakpoints could be missed.
  - Fixed issue tracing lamda functions.
  - pydevd.settrace() could end up not stopping the debugger properly.
  - Fixed critical error on debugger (could deadlock when creating a
  new thread).
   -

   *Code Formatter*
   -

  It's now possible to use the PyDev code formatter using the command
  line.
  - Install with: *pip install pydevf*
 - Fixes many common formatter errors.
 - Tries to keep code close to the original formatting.
 - see: https://github.com/fabioz/PyDev.Formatter for more details.
  -

  Fixed issue where blank line was being put in the wrong place in the
  PyDev code formatter.
  -

   Grammar: fixed issue parsing f-strings.
   - Fixed issue sending current line to interactive console (F2).

About PyDev

PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and
IronPython development, now also available for Python on Visual Studio Code.

It comes with goodies such as code completion, syntax highlighting, syntax
analysis, code analysis, refactor, debug, interactive console, etc.

It is also available as a standalone through LiClipse with goodies such as
multiple cursors, theming and support for many other languages, such as
Django Templates, Jinja2, Html, JavaScript, etc.

Links:

PyDev: http://pydev.org
PyDev Blog: http://pydev.blogspot.com
PyDev on VSCode: http://pydev.org/vscode
LiClipse: http://www.liclipse.com
PyVmMonitor - Python Profiler: http://www.pyvmmonitor.com/

Cheers,

Fabio Zadrozny
​
-- 
https://mail.python.org/mailman/listinfo/python-list


PyDev 6.4.3 Released

2018-07-06 Thread Fabio Zadrozny
*PyDev 6.4.3 Release Highlights*

PyDev changes:

   -

   *Debugger*
   - Notification of threads is done as they're created instead of
  synchronized afterwards.
  - Support for using frame evaluation disabled by default as it made
  the debugger much slower on some cases.
  - Fixed case where breakpoint was missed if an exception was raised
  in a given line.
  - Properly break on unhandled exceptions on threads.
  - Add missing import which affected repl with IPython.
  - Fix for case where breakpoints could be missed.
  - Fixed issue tracing lamda functions.
  - pydevd.settrace() could end up not stopping the debugger properly.
  - Fixed critical error on debugger (could deadlock when creating a
  new thread).
   -

   *Code Formatter*
   -

  It's now possible to use the PyDev code formatter using the command
  line.
  - Install with: *pip install pydevf*
 - Fixes many common formatter errors.
 - Tries to keep code close to the original formatting.
 - see: https://github.com/fabioz/PyDev.Formatter for more details.
  -

  Fixed issue where blank line was being put in the wrong place in the
  PyDev code formatter.
  -

   Grammar: fixed issue parsing f-strings.
   - Fixed issue sending current line to interactive console (F2).

About PyDev

PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and
IronPython development, now also available for Python on Visual Studio Code.

It comes with goodies such as code completion, syntax highlighting, syntax
analysis, code analysis, refactor, debug, interactive console, etc.

It is also available as a standalone through LiClipse with goodies such as
multiple cursors, theming and support for many other languages, such as
Django Templates, Jinja2, Html, JavaScript, etc.

Links:

PyDev: http://pydev.org
PyDev Blog: http://pydev.blogspot.com
PyDev on VSCode: http://pydev.org/vscode
LiClipse: http://www.liclipse.com
PyVmMonitor - Python Profiler: http://www.pyvmmonitor.com/

Cheers,

Fabio Zadrozny
​
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


[issue34054] multiprocessing should use time.monotonic() for timeout

2018-07-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7714

___
Python tracker 

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



[issue34054] multiprocessing should use time.monotonic() for timeout

2018-07-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7713

___
Python tracker 

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



[issue34054] multiprocessing should use time.monotonic() for timeout

2018-07-06 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c2368cbc83ca2bafeaea0e4760be4996046d0444 by Victor Stinner in 
branch 'master':
bpo-34054: multiprocessing uses time.monotonic() (GH-8118)
https://github.com/python/cpython/commit/c2368cbc83ca2bafeaea0e4760be4996046d0444


--

___
Python tracker 

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



[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2018-07-06 Thread Ned Batchelder


Ned Batchelder  added the comment:

Coverage.py is registering a handler to save data before the program ends.  The 
execv call is not in the coverage.py code, it's in the program that coverage.py 
is running.

--

___
Python tracker 

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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2018-07-06 Thread Tal Einat


Tal Einat  added the comment:

Now that transmogrify is done, the only open question is about itertools and 
collections.

1. Should collections be converted?
2. How to proceed with itertools? There are two PRs ready, with the one just 
for groupby() approved, but not yet reviewed by Raymond Hettinger.

--

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Tal Einat


Tal Einat  added the comment:

Thanks for all of your work on this, Ammar!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Tal Einat


Tal Einat  added the comment:


New changeset 7829bba45d0e2446f3a0ca240bfe46959f01071e by Tal Einat (Ammar 
Askar) in branch '2.7':
[2.7] bpo-33899: Make tokenize module mirror end-of-file is end-of-line 
behavior (GH-7891) (#8133)
https://github.com/python/cpython/commit/7829bba45d0e2446f3a0ca240bfe46959f01071e


--

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Tal Einat


Tal Einat  added the comment:


New changeset 11c36a3e16f7fd4e937466014e8393ede4b61a25 by Tal Einat (Ammar 
Askar) in branch '3.6':
[3.6] bpo-33899: Make tokenize module mirror end-of-file is end-of-line 
behavior (GH-7891) (GH-8134)
https://github.com/python/cpython/commit/11c36a3e16f7fd4e937466014e8393ede4b61a25


--

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Tal Einat


Tal Einat  added the comment:


New changeset ab75d9e4244ee24bc96ea9d52362899e3bf365a2 by Tal Einat (Ammar 
Askar) in branch '3.7':
[3.7] bpo-33899: Make tokenize module mirror end-of-file is end-of-line 
behavior (GH-7891) (GH-8132)
https://github.com/python/cpython/commit/ab75d9e4244ee24bc96ea9d52362899e3bf365a2


--

___
Python tracker 

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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2018-07-06 Thread Tal Einat


Tal Einat  added the comment:


New changeset c929df3b96c8d7e7977e581431192be21cdafd19 by Tal Einat in branch 
'master':
bpo-20180: complete AC conversion of Objects/stringlib/transmogrify.h (GH-8039)
https://github.com/python/cpython/commit/c929df3b96c8d7e7977e581431192be21cdafd19


--

___
Python tracker 

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



[issue16968] Fix test discovery for test_concurrent_futures.py

2018-07-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Seems that reap_children() in regrtest is ran only if the test is passed. And 
it doesn't produce warnings.

--

___
Python tracker 

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



[issue34042] Reference loss for local classes

2018-07-06 Thread Kay Hayen


Kay Hayen  added the comment:

Hello,

so it's harmless and it explains the other reference counting issue, where a 
change in call convention could make a reference counting bug show or go away:

codecs.open(TESTFN, encoding='cp949')
This was showing it, where as
codecs.open(TESTFN, "rb", 'cp949')

was not. With all the difference being a dictionary passed into a function call 
or not. I am now assuming that getting your fix this will also go away. Caused 
me a bit of head scratching already.

If you could do what you often you, and make this what distributions like 
Debian pull from, it would be good enough in terms of release for me, as it 
blocks Nuitka tests from passing on them.

Yours,
Kay

--

___
Python tracker 

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



[issue34007] test_gdb fails in s390x SLES buildbots

2018-07-06 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

All the builds fail consistently after 
http://buildbot.python.org/all/#/builders/54/builds/465 and things were passing 
before 465. Maybe is this something to do with the commit that happened there 
that we could revert and test it in the machine by doing a git-bisect? But I 
couldn't see anything on GDB related code being changed in Python on #465. My 
initial hunch was that it had something to do with GDB 8.0+ but Ubuntu 18.04 
LTS also runs on 8.0+ fine.

Tests pass : 00e05242ae650bc29e8052a5fb79cbb83224a657
Tests fail : d6a283b37b66ecd2d0ff43602ddc8e91b54a51c5

➜  cpython git:(master) git log 
00e05242ae650bc29e8052a5fb79cbb83224a657~1..d6a283b37b66ecd2d0ff43602ddc8e91b54a51c5

commit d6a283b37b66ecd2d0ff43602ddc8e91b54a51c5
Author: Zackery Spytz 
Date:   Fri Jun 29 13:30:07 2018 -0600

[3.6] bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). 
(GH-3918). (GH-8012)

(cherry picked from commit 23db935bcf258657682e66464bf8512def8af830)

Co-authored-by: Zackery Spytz 

commit a73027918a659ca69480a7e023d3838e2601ce6d
Author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
Date:   Fri Jun 29 03:17:43 2018 -0700

Fix the indentation in the documentation of bin() and hash() (GH-7998)

(cherry picked from commit bda9c3eae3ad16e43145599ac6359bfdcaf1fd4a)

Co-authored-by: Andrés Delfino 

commit 00e05242ae650bc29e8052a5fb79cbb83224a657
Author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
Date:   Thu Jun 28 22:32:16 2018 -0700

bpo-14117: Make minor tweaks to turtledemo (GH-8002)


The 'wikipedia' example is now 'rosette', describing what it draws.
The 'penrose' print output is reduced.  The 'tree' '1024'
output is eliminated.
(cherry picked from commit 891a1f86d415779cf67ca23e626a868e586feb05)

Co-authored-by: Terry Jan Reedy 

--
nosy: +xtreak

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Ammar Askar


Change by Ammar Askar :


--
pull_requests: +7712

___
Python tracker 

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



Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-06 Thread Mark via Python-list
In the end I changed to a completely different approach.

I now have two parallel directories, one with PySide-based code and the other 
with auto-generated PyQt-based code. And I created a tiny script to copy the 
PySide code to the PyQt directory & do the necessary changes. (I can post the 
script if anyone's interested.)

This means that there are no import hacks and no (manual) duplication, while 
still being easy to test using either binding library.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Matplotlib 3D limitations, please recommend alternative

2018-07-06 Thread John Ladasky
On Wednesday, July 4, 2018 at 6:38:18 PM UTC-7, William Ray Wing wrote:
> > On Jul 4, 2018, at 5:53 PM, John Ladasky  wrote:
[snip]
> > I explored Python OpenGL bindings about three years ago, and quickly got 
> > bogged down.  Even with Python to assist, dealing with OpenGL was like 
> > trying to program Java.  Of course, OpenGL can do EVERYTHING.  Far more 
> > than I need.
> > 
> 
> The Python Open GL bindings have apparently changed fairly dramatically.  I’m 
> no expert, I’m working my way through the on-line book here:
> 
>   http://www.labri.fr/perso/nrougier/python-opengl/
> 
> But the author DOES lay things out in a nice step by step fashion - and with 
> particular emphasis on scientific 3D plotting (which is what I’m after).

I've started to read your link.  Maybe I will attempt OpenGL a second time.  

I found my posts documenting my request for help the last time that I attempted 
OpenGL here:

https://groups.google.com/forum/#!msg/comp.lang.python/Hj-UHbAFpWs/7vz-vcSHCAAJ;context-place=forum/comp.lang.python

Back then I wrote:

"I have concluded that Qt, PyQt, and OpenGL are all rapidly-evolving, and huge, 
software packages.  There may be compatibility problems, and relevant examples 
with the right software combination may be hard to find.  Two weeks of 
searching web pages hasn't turned up a single example which demonstrates PyQt5 
doing something simple in 3D with OpenGL that I can study."

It's nice to see that Nicolas Rougier confirms exactly that very near the 
beginning of his book (Section 2.1, "A bit of history").

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


[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Ammar Askar


Change by Ammar Askar :


--
pull_requests: +7711

___
Python tracker 

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



Re: Matplotlib 3D limitations, please recommend alternative

2018-07-06 Thread John Ladasky
On Wednesday, July 4, 2018 at 3:30:32 PM UTC-7, Rick Johnson wrote:
> On Wednesday, July 4, 2018 at 4:53:19 PM UTC-5, John Ladasky wrote:
> > There are many 3D graphics packages on PyPI.  Some appear to be quite 
> > specialized.  I would appreciate your recommendations.  Thanks!
> 
> If you don't want to mess with pyOpenGL, then try VPython.

Thanks for the suggestion Rick, I have found some VPython examples here:

http://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Ammar Askar


Change by Ammar Askar :


--
pull_requests: +7710

___
Python tracker 

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



Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-06 Thread Antoon Pardon
On 05-07-18 14:57, Mark Summerfield via Python-list wrote:
> For GUI programming I often use Python bindings for Qt.
>
> There are two competing bindings, PySide and PyQt.
>
> Ideally I like to have applications that can use either. This way, if I get a 
> problem I can try with the other bindings: if I still get the problem, then 
> it is probably me; but if I don't it may be an issue with the bindings.
>
> But working with both means that my imports are very messy. Here's a tiny 
> example:
>
> if PYSIDE: # bool True -> Use PySide; False -> Use PyQt5
> from PySide2.QtCore import Qt
> from PySide2.QtGui import QIcon
> from PySide2.QtWidgets import (
> QDialog, QFrame, QGridLayout, QLabel, QLineEdit, QPushButton,
> QVBoxLayout)
> else:
> from PyQt5.QtCore import Qt
> from PyQt5.QtGui import QIcon
> from PyQt5.QtWidgets import (
> QDialog, QFrame, QGridLayout, QLabel, QLineEdit, QPushButton,
> QVBoxLayout)
>
> The PYSIDE constant is imported from another module and is used for all .py 
> files in a given project so that just by changing PYSIDE's value I can run an 
> entire application with PySide2 or with PyQt5.

The following is untested but what about

if PYSIDE:
import PySide2 as PyQt
else:
import PyQt5 as PyQt

Qt = PyQt.QtCore.Qt
QIcon = PyQt.QtGui.QIcon
...

-- 
Antoon Pardon

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


[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2018-07-06 Thread INADA Naoki


Change by INADA Naoki :


--
keywords: +patch
pull_requests: +7709
stage:  -> patch review

___
Python tracker 

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



[ANN] PyYAML-3.13: YAML parser and emitter for Python

2018-07-06 Thread Ingy dot Net

 Announcing PyYAML-3.13


A new bug fix release of PyYAML is now available:

http://pyyaml.org/wiki/PyYAML

*** Important Note From Maintainers ***

This is the first PyYAML release by the new maintainers. It was made
critical
because PyYAML-3.12 did not work with the recent Python 3.7 release.

A more ambitious 4.1 release was attempted last week and needed to be
retracted
for many reasons. We apologize any pain caused by the 4.1 removal, but we
remain confident that it was the best decision.

There are over 60 pull requests in PyYAML and LibYAML that will be
represented
in the upcoming 4.2 release and we are working hard to get those to you as
soon
as the release is ready (but no sooner :).

We are are excited that the PyYAML project is moving forward again.

-- The PyYAML Maintenance Team



Changes
===

* Rebuilt with the latest Cython to support the new Python 3.7 release.
* No functionality is different from PyYAML 3.12 in this release.


Resources
=

PyYAML IRC Channel: #pyyaml on irc.freenode.net
YAML IRC Channel: #yaml-dev on irc.freenode.net
LibYAML IRC Channel: #libyaml on irc.freenode.net

PyYAML homepage: http://pyyaml.org/wiki/PyYAML
PyYAML documentation: http://pyyaml.org/wiki/PyYAMLDocumentation
Source and binary installers: https://pypi.python.org/pypi/PyYAML/3.13

GitHub repository: https://github.com/yaml/pyyaml/
Bug tracking: https://github.com/yaml/pyyaml/issues

YAML homepage: http://yaml.org/
YAML-core mailing list:
http://lists.sourceforge.net/lists/listinfo/yaml-core


About PyYAML


YAML is a data serialization format designed for human readability and
interaction with scripting languages. PyYAML is a YAML parser and emitter
for
Python.

PyYAML features a complete YAML 1.1 parser, Unicode support, pickle support,
capable extension API, and sensible error messages. PyYAML supports standard
YAML tags and provides Python-specific tags that allow to represent an
arbitrary Python object.

PyYAML is applicable for a broad range of tasks from complex configuration
files to object serialization and persistance.


Example
===

>>> import yaml

>>> yaml.load("""
... name: PyYAML
... description: YAML parser and emitter for Python
... homepage: http://pyyaml.org/wiki/PyYAML
... keywords: [YAML, serialization, configuration, persistance, pickle]
... """)
{'keywords': ['YAML', 'serialization', 'configuration', 'persistance',
'pickle'], 'homepage': 'http://pyyaml.org/wiki/PyYAML', 'description':
'YAML parser and emitter for Python', 'name': 'PyYAML'}

>>> print yaml.dump(_)
name: PyYAML
homepage: http://pyyaml.org/wiki/PyYAML
description: YAML parser and emitter for Python
keywords: [YAML, serialization, configuration, persistance, pickle]


Maintainers
===

The following people are currently responsible for maintaining PyYAML:

* Ingy döt Net
* Tina Mueller
* Matt Davis

and many thanks to all who have contribributed!
See: https://github.com/yaml/pyyaml/pulls


Copyright
=

Copyright (c) 2017-2018 Ingy döt Net 
Copyright (c) 2006-2016 Kirill Simonov 

The PyYAML module was written by Kirill Simonov .
It is currently maintained by the YAML and Python communities.

PyYAML is released under the MIT license.
See the file LICENSE for more details.
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


[ANN] Mayavi-4.6.1 release

2018-07-06 Thread Prabhu Ramachandran
Hello,

We are pleased to announce Mayavi-4.6.1. Mayavi is a general purpose,
cross-platform Python package for 2-D and 3-D scientific data visualization.
Mayavi integrates seamlessly with NumPy and provides a convenient Pythonic
wrapper for VTK (http://www.vtk.org). It provides a stand-alone UI to help
visualize your data. Mayavi is easy to extend and embed in your own dialogs
and UIs.

For more information see here:

  http://docs.enthought.com/mayavi/mayavi/index.html


Changes
---

- Make the use of an extension module optional. This allows installation via
  pip without needing to have a compiler.
- Fixed installation with pip when numpy is not installed.
- Support for PySide2.
- Add methods to make it easy to add attributes to datasets.
- Fixed several issues.

For more details see
http://docs.enthought.com/mayavi/mayavi/auto/changes.html#mayavi-4-6-1

We are thankful to Eric Larson, Hongzhuo Liang, and Prabhu Ramachandran for
their contributions. We are grateful to Enthought for their support which has
made this release possible.

cheers,
Mayavi developers

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

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


[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2018-07-06 Thread INADA Naoki


INADA Naoki  added the comment:

In C version, we don't use key func.

items = PyMapping_Items(dct);
if (items == NULL)
goto bail;
if (s->sort_keys && PyList_Sort(items) < 0) {

Like that, how about removing key function completely?

--
nosy: +inada.naoki

___
Python tracker 

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



Re: PEP 526 - var annotations and the spirit of python

2018-07-06 Thread Antoon Pardon
On 06-07-18 08:17, Steven D'Aprano wrote:
> On Thu, 05 Jul 2018 16:09:52 +0200, Antoon Pardon wrote:
>
>>> This is not an innovation of Mypy. It's how type inference is supposed
>>> to work. If a particular type checker doesn't do that, it is doing it
>>> wrong.
>> That is how type interference works in languages that have some kind of
>> static typing like Haskell.
> No, that's how type inference works in dynamically typed languages like 
> Python as well. See Mypy for an example.

Sorry, but this kind of wording is misleading to me. IMO, it strongly suggests
that we can have type inference in python without losing any of the dynamism.

The impression that I got from this thread was that you could just trow any
python program through mypy and it would work.

> But if you opt-in to using a type-checker, the assumption is that you are 
> writing in a less-dynamic, more-static style that will actually get some 
> advantage from static type checking. If you're not doing so, then you're 
> just annoying yourself and wasting time and you won't enjoy the 
> experience one bit.

Thank you for this clarification. It seems that we are largely agreeing but
I seem to have understood your past contributions differently than you intended.

-- 
Antoon.

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


[issue34043] Optimize tarfile uncompression performance

2018-07-06 Thread INADA Naoki


Change by INADA Naoki :


--
resolution:  -> fixed
stage: patch review -> 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



[issue34057] Py_Initialize aborts when using static Python version. Windows

2018-07-06 Thread STINNER Victor


STINNER Victor  added the comment:

> Why is Python looking for external modules when it is a statically linked 
> library and encodings should be built-in?

Hi, this is not a bug. Python needs its standard library. You might want to put 
the whole stdlib into a single ZIP, but I don't recall how to do that.

The encodings and codecs modules are not built-in, but _codecs is built-in:

>>> import encodings, codecs, _codecs
>>> encodings

>>> codecs

>>> _codecs


I suggest to close this issue as "not a bug". You should ask on a Python 
mailing list or forum to get help how to build a standalone Python.

--

___
Python tracker 

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



[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2018-07-06 Thread Tal Einat


Tal Einat  added the comment:

> we could definitely have a separate "atexec" handler

Couldn't coverage.py and similar apps can just invoke the atexit handlers 
before calling os.execv() or similar?  If so, perhaps a mention of this in the 
docs would suffice?

--
nosy: +taleinat

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-07-06 Thread Tal Einat


Tal Einat  added the comment:


New changeset c4ef4896eac86a6759901c8546e26de4695a1389 by Tal Einat (Ammar 
Askar) in branch 'master':
bpo-33899: Make tokenize module mirror end-of-file is end-of-line behavior 
(GH-7891)
https://github.com/python/cpython/commit/c4ef4896eac86a6759901c8546e26de4695a1389


--
nosy: +taleinat

___
Python tracker 

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



  1   2   >