Re: Decoratored functions parsed differently by ast stdlib between 3.7 and 3.8

2021-05-03 Thread Terry Reedy

On 4/30/2021 11:07 PM, Mike Lee Williams wrote:

On Friday, April 30, 2021 at 7:55:10 PM UTC-7, Mike Lee Williams wrote:

This trivial bit of code is parsed differently by the ast module between python
3.7 and python 3.8. I'm trying to figure out what changed and why, and once I
know that, if it's possible and desirable to retain the 3.7 behavior for my use
case (which needs to give the same result for this input on 3.7 and 3.8).


Answering my own question: the behavior was changed by 
https://github.com/python/cpython/pull/9731.


Since this patch, Mark Shannon has revised line numbering and tracing 
and replaced the internal lineno data structure. Your example code still 
outputs 2.  So Mark either missed this case or considers it correct.


--
Terry Jan Reedy

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


byexample: free, open source tool to find snippets of code in your docs and execute them as regression tests

2021-05-03 Thread Martin Di Paola

Hi everyone, I would like to share a free, open source tool with you that
I've been developing in the last few years.

You'll be probably familiar with things like this in the Python
documentation:

```
  >>> 1 + 3
  4
```

byexample will find those snippets, it will execute "1 + 3" and the
output will be compared with the expected one (the "4") so you can know
that your docs are in sync with your code.

If you are familiar with Python's doctest module, it is the same idea
but after a few years of using it I found some limitations that I tried
to break.

That's how byexample was born: it allows you find and execute
the snippets/examples written in different languages in different files.

You could run Ruby and C++ code written in the docstrings of your Python
source code or in a fenced code block of a Markdown file.

You could "capture" the output of one example and "paste" it into
another as a way to share data between examples.

```
  $ cat somefile   # a Shell example ( will capture a word)
  Lorem ipsum  sit amet.

  >>> "" == "dolor"  # Python example  # byexample: +paste
  True
```

You could even "type" text when your example is interactive and requires
some input:

```
  >>> name = input("your name please: ")  # byexample: +type
  your name please: [john]

  >>> print(name)
  john
```

There are a few more features but this email is long enough.

The full set of features and tutorials are in https://byexamples.github.io
(by the way, the examples in that web page are the tests of byexample!)

Repo: https://github.com/byexamples/byexample (feel free to submit any
issue or question)

You can install it with pip:

  pip install byexample

And if you are a fan of Python's doctest (as I am), there is a
compatibility mode that you may want to check:
https://byexamples.github.io/byexample/recipes/python-doctest

I would like to receive your feedback.

Thanks for your time!
Martin.
--
https://mail.python.org/mailman/listinfo/python-list


for the requirement of pygames

2021-05-03 Thread mishrasamir2004
   Sir/madam ,

I'm a user of python, and I'm requesting you to
   provide me pygames .

  Samir Mishra

  Phone no. = +91 7044421272



   Sent from [1]Mail for Windows 10



References

   Visible links
   1. https://go.microsoft.com/fwlink/?LinkId=550986
-- 
https://mail.python.org/mailman/listinfo/python-list


Removing For-Loop

2021-05-03 Thread Korn Moffle
Hi,

I have been banging my head against the wall - I know I can get rid of for-loop 
here, but can't figure out how. Please help! I suspect I can do np.sum on the 
whole adGroup but I am lacking the imagination to visualize it.

for ind in range(adGroup.shape[0]):
row = adGroup.iloc[ind, :]
current_hashes, current_cf_id = 
adArrayHashes[row['hash_seq_array'].astype(int)], [row['cf_id']]

# calculaton
hashes_diff = np.array(list(map(lambda x:
np.sum(np.not_equal(start_hashes[x:x + 
len(current_hashes)], current_hashes),
axis=1),
range(58)
)))
hashes_diff_scores = np.sum(hashes_diff <= IMG_DIFFER, axis=1)
hashes_diff_mask = hashes_diff_scores >= SEQ_THRESHOLD
if any(hashes_diff_mask):
presumptive_cf_ids.append(current_cf_id[0])
presumptive_scores.append(max(hashes_diff_scores))

if queue != 0: queue.put((presumptive_cf_ids, presumptive_scores))
# return presumptive_cf_ids, presumptive_scores
return

Sent from Outlook
-- 
https://mail.python.org/mailman/listinfo/python-list


Python language packages isn't working in Visual Studio Code

2021-05-03 Thread Osmany Guerra
Hi, I have problem with the python interpreter in the Visual Studio Code.
It was running ok, but now isn't working. I have downloaded, installed and
unistalled several times without having results. How could I fix that?
I'm using windows 10 64-bit,  VSCode x64-1.55.2, and Python 3.9.4.
I'm sending you a picture of my laptop screen too.
Waiting for your reply
Regards Osmany
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Decoratored functions parsed differently by ast stdlib between 3.7 and 3.8

2021-05-03 Thread Mike Lee Williams
On Monday, May 3, 2021 at 10:41:14 AM UTC-7, Terry Reedy wrote:
> > Answering my own question: the behavior was changed by 
> > https://github.com/python/cpython/pull/9731.
> Since this patch, Mark Shannon has revised line numbering and tracing 
> and replaced the internal lineno data structure. Your example code still 
> outputs 2. So Mark either missed this case or considers it correct. 

Yes, reading through the correspondence it's clear that the view is that the 
old behavior was a bug and this change is a bugfix. I can work around this for 
my use case.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python language packages isn't working in Visual Studio Code

2021-05-03 Thread inhahe
I don't think attaching images works on this kind of list. Maybe send a
link to it..

On Mon, May 3, 2021 at 1:51 PM Osmany Guerra 
wrote:

> Hi, I have problem with the python interpreter in the Visual Studio Code.
> It was running ok, but now isn't working. I have downloaded, installed and
> unistalled several times without having results. How could I fix that?
> I'm using windows 10 64-bit,  VSCode x64-1.55.2, and Python 3.9.4.
> I'm sending you a picture of my laptop screen too.
> Waiting for your reply
> Regards Osmany
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python language packages isn't working in Visual Studio Code

2021-05-03 Thread Joel Goldstick
On Mon, May 3, 2021 at 2:00 PM inhahe  wrote:
>
> I don't think attaching images works on this kind of list. Maybe send a
> link to it..
>
> On Mon, May 3, 2021 at 1:51 PM Osmany Guerra 
> wrote:
>
> > Hi, I have problem with the python interpreter in the Visual Studio Code.
> > It was running ok, but now isn't working. I have downloaded, installed and
> > unistalled several times without having results. How could I fix that?
> > I'm using windows 10 64-bit,  VSCode x64-1.55.2, and Python 3.9.4.
> > I'm sending you a picture of my laptop screen too.
> > Waiting for your reply
> > Regards Osmany
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
> --
> https://mail.python.org/mailman/listinfo/python-list

Better yet, cut and paste your relevant text in your email message here

-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays
-- 
https://mail.python.org/mailman/listinfo/python-list


[RELEASE] Python 3.8.10, 3.9.5, and 3.10.0b1 are now available

2021-05-03 Thread Łukasz Langa
This has been a very busy day for releases and on behalf of the Python 
development community we’re happy to announce the availability of three new 
Python releases.

Python 3.10 is now in Beta

Get it here: Python 3.10.0b1 

Python 3.10 is still in development. 3.10.0b1 is the first of four planned beta 
release previews. Beta release previews are intended to give the wider 
community the opportunity to test new features and bug fixes and to prepare 
their projects to support the new feature release.

We strongly encourage maintainers of third-party Python projects to test with 
3.10 during the beta phase and report issues found to the Python bug tracker 
 as soon as possible. While the release is planned to 
be feature complete entering the beta phase, it is possible that features may 
be modified or, in rare cases, deleted up until the start of the release 
candidate phase (Monday, 2021-08-02). Our goal is have no ABI changes after 
beta 4 and as few code changes as possible after 3.10.0rc1, the first release 
candidate. To achieve that, it will be extremely important to get as much 
exposure for 3.10 as possible during the beta phase.

Please keep in mind that this is a preview release and its use is not 
recommended for production environments.

The next pre-release, the second beta release of Python 3.10, will be 3.10.0b2. 
It is currently scheduled for 2021-05-25. Please see PEP 619 
 for details.

Development Begins on Python 3.11

With Python 3.10 moving to beta, it received its own 3.10 branch in the 
repository . All new features are now 
targeting Python 3.11, to be released in October 2022.

Using the opportunity with the creation of the 3.10 branch, we renamed the 
master branch of the repository to main. It’s been a bit rocky 

 but looks like we’re open for business. Please rename the main branch of your 
personal fork using the guide GitHub will give you when you go to your fork’s 
main page. In case of any outstanding issues, please contact the 3.11 RM 
.

Python 3.9.5

Get it here: Python 3.9.5 
Python 3.9.5 is the newest major stable release of the Python programming 
language, and it contains many new features and optimizations. There’s been 111 
commits since 3.9.4 which is a similar amount compared to 3.8 at the same stage 
of the release cycle. See the change log 
 for details.

On macOS, we encourage you to use the universal2 variant whenever possible. The 
legacy 10.9+ Intel-only variant will not be provided for Python 3.10 and the 
universal2 variant will become the default download for future 3.9.x releases. 
You may need to upgrade third-party components, like pip, to later versions 
once they are released. You may experience differences in behavior in IDLE and 
other Tk-based applications due to using the newer version of Tk. As always, if 
you encounter problems when using this installer variant, please check 
https://bugs.python.org  for existing reports and for 
opening new issues.

The next Python 3.9 maintenance release will be 3.9.6, currently scheduled for 
2021-06-28.

The Last Regular Bugfix Release of Python 3.8

Get it here: Python 3.8.10 

According to the release calendar specified in PEP 569 
, Python 3.8.10 is the final regular 
maintenance release. Starting now, the 3.8 branch will only accept security 
fixes and releases of those will be made in source-only form until October 
2024. To keep receiving regular bug fixes, please upgrade to Python 3.9.

Compared to the 3.7 series, this last regular bugfix release is relatively 
dormant at 92 commits since 3.8.9. Version 3.7.8, the final regular bugfix 
release of Python 3.7, included 187 commits. But there’s a bunch of important 
updates here regardless, the biggest being macOS Big Sur and Apple Silicon 
build support. This work would not have been possible without the effort of 
Ronald Oussoren, Ned Deily, Maxime Bélanger, and Lawrence D’Anna from Apple. 
Thank you!

Take a look at the change log 
 for details.

We hope you enjoy the new releases

Your friendly release team,
Ned Deily @nad 
Steve Dower @steve.dower 
Pablo Galindo Salgado @pablogsal 
Łukasz Langa @ambv 
-- 
https://mail.python.org/mailman/listinfo/pyth

Re: uninstall

2021-05-03 Thread Sian Doherty
Thanks for the advice. I found a stack overflow post that suggested just
removing manually and cleaning out the registry too. I think I have it
under control but I haven't gotten around to reinstalling it yet.

On Sun, 2 May 2021, 10:05 Mats Wichmann,  wrote:

> On 4/29/21 6:59 PM, Sian Doherty wrote:
> > I’m trying to uninstall Python 3.8.5 on Windows 10 Pro 20H2 as I had
> multiple environments and as a result corrupted them.
> >
> > When I uninstall from control panel, it takes less than a second and
> says it uninstalled successfully but I can still access python through the
> command prompt by typing python.
> >
> > Is there a different way to uninstall that isn’t through the control
> panel? I would have thought I would do that and then clean out the registry
> separately and the %localappdata%\pip folder.
> >
> > Any thoughts?
>
> There are some uninstall tools, of varying quality. Some depend on you
> having been running them while the install happened, which is probably
> not the case for you. Once you've messed up Windows' idea of the install
> subsystem, it's not that easy to recover. Though some may disagree,
> that's not really Python's fault, the install system seems pretty
> fragile.  Sometimes if the the files needed to process the uninstall
> have been removed but the uninstall itself didn't finish you're in
> trouble - which isn't really the fault of the install system, but then
> you ask how that scenario arose? anyway...
>
> You could look for this tool:
> MicrosoftProgram_Install_and_Uninstall.meta.diagcab - an Internet search
> should find it. it usually does a fairly good job of cleaning up messes
> (well - it's worked well for me in a few dire situations).
>
-- 
https://mail.python.org/mailman/listinfo/python-list