Re: do ya still use python?

2021-04-22 Thread Terry Reedy

On 4/21/2021 6:07 AM, o1bigtenor wrote:

On Tue, Apr 20, 2021 at 6:26 PM Terry Reedy  wrote:


On 4/20/2021 4:32 AM, Alan Gauld via Python-list wrote:


We see the same trend on the tutor list, traffic has dropped off
by a factor of 3-5 times what it was at its peak. And the questions
are changing too, fewer basic things about loops and writing
functions, more about specific library modules and such.


I suspect that at least some such questions have good answers on
StackOverflow that questioners could profitably read first.


Respectfully - - - - I would disagree.
I am finding when I'm looking for answers that the generalist sites
most often cough up responses - - - - - yes there are responses
- - - but those responses are for software of at best 5 to 6 years
ago and all too often its for software of 15 + years ago.


Alan and I were specifically discussing questions about Python standard 
library modules, which are currently maintained and mostly stable.  Many 
beginner questions are likely to have useful answers tagged , 
, and sometimes something more specific.


Someone on the tutor list could even look on SO for the beginner and 
perhaps answer with a link.  But that is for Alan, etc, to decide.  I 
merely offered that as a suggestion.


--
Terry Jan Reedy

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


The split() function of Python's built-in module has changed in a puzzling way - is this a bug?

2021-04-22 Thread Andy AO
Upgrading from Python 3.6.8 to Python 3.9.0 and executing unit tests
revealed a significant change in the behavior of re.split().

but looking at the relevant documentation — Changelog  and re - Regular expression
operations - Python 3.9.4 documentation

yet no change is found.

number = '123'def test_Asterisk_quantifier_with_capture_group(self):
resultList = re.split(r'(\d*)', self.number)
if platform.python_version() == '3.6.8':
self.assertEqual(resultList,['', '123', ''])

else:
self.assertEqual(resultList,['', '123', '', '', ''])

I feel that this is clearly not in line with the description of the
function in the split documentation, and it is also strange that after
replacing * with +, the behavior is still the same as in 3.6.8.

   1. why is this change not in the documentation? Is it because I didn’t
   find it?
   2. Why did the behavior change this way? Was a bug introduced, or was it
   a bug fix?
-- 
https://mail.python.org/mailman/listinfo/python-list


Fun Generators

2021-04-22 Thread Travis Griggs
Doing an "industry experience" talk to an incoming class at nearby university 
tomorrow. Have a couple points where I might do some "fun things" with python. 
Said students have been learning some python3.

I'm soliciting any *fun* generators people may have seen or written? Not so 
much the cool or clever ones. Or the mathematical ones (e.g. fib). Something 
more inane and "fun". But still showcasing generators uniqueness. Short and 
simple is good.

Thanks in advance!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fun Generators

2021-04-22 Thread Frank Millman

On 2021-04-23 7:34 AM, Travis Griggs wrote:

Doing an "industry experience" talk to an incoming class at nearby university tomorrow. 
Have a couple points where I might do some "fun things" with python. Said students have 
been learning some python3.

I'm soliciting any *fun* generators people may have seen or written? Not so much the cool 
or clever ones. Or the mathematical ones (e.g. fib). Something more inane and 
"fun". But still showcasing generators uniqueness. Short and simple is good.

Thanks in advance!



Have you looked at this?

http://www.dabeaz.com/generators/

Frank Millman

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