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 htt

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

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. Berri

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 t

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 contain

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

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. >> >>

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

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 referenc

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

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 sch

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

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: >

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 c

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 som

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 fu

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

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. 

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

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

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 go

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-gen

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

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 lang

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,

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. - Fix

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 scrip

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

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

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:

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 wor

Re: Dealing with dicts in doctest

2018-07-06 Thread Serhiy Storchaka
05.07.18 20:57, Steven D'Aprano пише: I think that's really clever. Is it too clever? How do you deal with dicts in doctests? There was a proposition for adding a doctest option for order-insensitive matching (like NORMALIZE_WHITESPACE and ELLIPSIS). But it was rejected because there is a sim