[issue41446] New demo, using a web api

2020-08-01 Thread Mariatta


Mariatta  added the comment:

Thanks for your interest in adding this to CPython but I think this demo does 
not belong in CPython repository. Perhaps it should be written as a demo for 
helioviewer API and be part of helioviewer documentation. We already have a 
documentation for urllib for how to make API calls.

--
nosy: +Mariatta
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: Non IDE development strategy - what do others do that's fairly simple?

2020-08-01 Thread Cameron Simpson
On 29Jul2020 11:20, Chris Green  wrote:
>The existing code simply lives in ~/bin with a couple of modules in
>~/bin/pymods (which directory is in my PYTHONPATH).
>
>I use mercurial for configuration management of the code, directly in
>the ~/bin directory.  This works fine for the sort of minor bug fixing
>and updates that I do most of the time, I'm the only user so changing
>the 'live' code isn't a major issue and I can always drop back to the
>last working version using mercurial.

Step 1 is to copy this sideways: keep the existing setup, but do the dev 
in a separate directory. The Mykefile in my personal dev directory has a 
"_home" target which installed the current state of play into my home 
directory.

Once you have that, it is easy to make more clones to pursue things 
separately.

>So, finally to the question, does anyone else have this command line
>based sort of approach and, if so, what do they do to provide a
>'development version' of a program in parallel with a working version?

To that last part, I have a personal script "env-dev" (aliased as just 
"dev"), here:

https://hg.sr.ht/~cameron-simpson/css/browse/bin/env-dev?rev=tip

Feel free to copy it.

Its purpose is to run the code from the current directory by prefixing 
various path environment variables, etc. Additionally it sources the 
file ".env.sh" in the current directory or ancestor for customisation 
beyond what it does automatically. It also utilises the venv if present.

So to run the test code I go:

$ dev the-programme ...

and it uses the scripts and modules in my development directory.

>I guess virtualenv (Python 2) and venv (Python 3) address this problem
>but they do feel rather more complex than I actually need and I'm not
>very clear how you move code from the virtual environment to 'live'.

The nice thing about a virtualenv is that you can run specific Python 
versions with specific modules installed. It is easy to keep a few 
around.

You utilise the virtualenv by invoking via the "python" executable 
within the virtualenv. That hooks up the virtualenv for the run. (Ignore 
"activate", it is a confusing source of pain IMO.)

Moving to "production" is just a matter of maintaining a production 
virtualenv, using the python and modules you see fit for production.

For example, I keep a virtualenv in the "venv" subdirectory of the 
development tree. I keep a personal, "production", virtualenv in 
~/var/venv/3, and ~/var/venv/3/bin is towards the front of my $PATH.

Typically you keep a "requirements.txt" file in your dev tree which 
specifies the modules you want. The filename is just a convention. The 
to update production you'd just go:

~/var/venv/3/bin/pip install -U -r requirements.txt

where "~/var/venv/3/bin/pip" is _my_ production venv - adjust for your 
own, and "requirements.txt" is the reference file you want to use.

>There's also the issue that I'm moving code from Python 2 to Python 3
>so which virtual environment should I use?

Make one of each - that way it is easy to run your tests against either 
or both at once. So maybe (in your dev tree) make a "venv2" with a 
Python 2 virtualenv and a "venv3" with a Python 3 one, then you can run 
python out of each as required.

Also, keep a make target to build the virtualenvs. Here's mine, which 
just does one based on "python3".

dev = env-dev -d $. -x
base_python = python3
venv_dir = $./venv
venv_requirements = $./venv-requirements.txt
venv_pip = $(venv_python) -m pip
venv_python = $(venv_dir)/bin/python

_venv:
@[ -d '$(venv_dir)/' ] || set-x mkdir '$(venv_dir)'
[ -x '$(venv_python)' ] || { \
  set -xue \
  rm -rf '$(venv_dir)' \
  $(base_python) -m venv '$(venv_dir)' \
}
$(dev) $(venv_pip) install -U wheel pip
$(dev) $(venv_pip) install -U -r $(venv_requirements)


Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread dn via Python-list

On 02/08/2020 12:42, o1bigtenor wrote:

On Sat, Aug 1, 2020 at 7:24 PM o1bigtenor  wrote:

On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list
 wrote:

On 01/08/2020 23:36, o1bigtenor wrote:

On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list
mailto:python-list@python.org>> wrote:
 On 31/07/2020 02:52, o1bigtenor wrote:
  > I regularly work in planning through multiple years at once.
  > This means that I like to have a lot of stuff available in a calendar
  > function.



Doing some searching - - - - sub-class really doesn't have a lot of 'official'
info. Perhaps an information source might be pointed out?


You're further along that path than I!

Sometimes the authors maintain an helpful web site/page, but I don't know.


...


Reading through more docs there is a possibility of using the 'format'
command. Would need to first come up with a way of describing the
months (with their attendant week numbers) and then describe a
formating system which would then enable a use of 'print' to achieve
the desired goal.

Is this perhaps a good way of doing this?


Outlined earlier.


Question: what is the specification for 'first month' and 'last month' 
in the calendar?


i) year-based: eg from 2020-2023, represents 48 months starting from Jan 
2020 and continuing until Dec 2023 (inclusive).


ii) month-based: there is no need to 'start' with January, or to finish 
in December, eg 2020-08 -> 2023-07


iii) week-based: (included because of evident import in your thinking), 
eg 2020-W26 -> 2023W25

- watch out for leap years!

The last introduces the (very inconvenient) possibility of the first or 
last month being an incomplete 4~6 week 'block' and thus perhaps 
doubling the complexity of the "merge". However, it may be more 
convenient to translate weekNR into monthNR (and thus, name) than the 
reverse.

(that's a question? not statement!)
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread dn via Python-list

On 02/08/2020 12:24, o1bigtenor wrote:

On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list
 wrote:

On 01/08/2020 23:36, o1bigtenor wrote:

On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list
mailto:python-list@python.org>> wrote:
 On 31/07/2020 02:52, o1bigtenor wrote:
  > I regularly work in planning through multiple years at once.

...


calendar starting
from a date that is 3 years in time frame.

...


I would like to show something like 2024 through the end of 2028.

...

It is very disappointing - - - -suggests that thinking outside the space of
one year is somehow deprecated. Frustrated when what you do demands
that you think in longer periods of time (and yet have to function within
the week as well).


I agree - says he who tactically changes his 'events calendar' every 
half-year, to ensure that there is more than a six-month planning 
horizon. Sister-in-Law has just this morning blocked-out dates for 
family gatherings ("you are expected to attend!") for not just 
Christmas/December, but into Jan, Feb, and Easter holidays (Uni 
vacation) next year; because U.David is but a mere-male and needs lots 
of 'extra help'...

(and because she knows 'the system', and has something similar at home!)



There are other helper functions. Also, we are invited to sub-class.


Hmm - - - will have to investigate that.


I'm thinking that the month function/method might be a better way to go 
(than year-at-a-time).


For visualisation (per next para), have you tried computing a month in 
the REPL and then str.split()-ting the output into separate week-strings?




Might it be possible to generate multiple year (or month) groups, split
them by line, and then reassemble line-by-line to produce the width and
temporal length required?


Likely work well if the months were considered as discrete blocks.
Thinking that one could have something like

January 20xx  February 20xx
   Su  Mo  Tu  We  Th  Fr  Sa Su  Mo  Tu  We  Th  Fr  Sa
1  1 2 3455
  12
2 6 78 910  11  12   6 3 45 6
7   89
313   14  15   16   17  18  19   710   11  12   13   14  15  16
420   21  22   23   24  25  26   8
527   28  29   30   31

It is very useful for me to have the week numbers included. Have
learned some fascinating things (some months have 6 weeks in
them!) and the joys of formating (grin!).


What do you think?


I'm no expert with the calendar module, having used it as many times as 
(probably only) once before!


However, skim-reading that page of the docs, I'd say that using the 
class to do the formatting is better than 'reinventing the wheel', and 
thus the question becomes: could the 'standard output' be post-processed 
into the form required?


The outline above (ignoring month/year and day headings) is basically:

weekNR  gap weekNR month> ...


as far across the page/screen as there is space/per the requirements.

Given that a  seems to be a fixed-length string, then 
you could indeed employ format() or f-strings with formatting.


The fact that some months have fewer, or more, weeks to include, is 
largely irrelevant. The solution is a standard "merge" algorithm. (us 
'silver surfers' cut our teeth on sorting, searching, and merging as the 
three pillars of "batch processing").


To print across the page/screen, we divide the available number of 
character-columns by the number of columns a single month's data 
requires (plus inter-month spacing) and this gives the maximum number of 
months the can be displayed 'across'.


Dividing that number into the number of months within the period, will 
give the number of month-rows required to 'do the job'.


A month-row could be defined as: 'as many lines as it takes to display 
every week of the month' (plus vertical separation/spacing).


So, now the challenge is to print each output line, combining 
(laterally) all of the relevant data/dates, in such a manner that after 
every so-many output lines, the visual-blocks representing each 
individual month's dates will become apparent.


The "merge" for line n (n:1-4~6) means to take the n-th  
from each month in the current month-row and format them into a single 
o/p line. If a month does not have an n-th week, then substitute the 
requisite number of spaces (unless handled by f-string/format() 
"width"). Print the o/p line...

(yes, I omitted the weekNR-s, but adding them is trivial)



I was starting from what I understood (how to print 'a' year) working
to get closer to what I could use. Ncal allows me to display a
calendar except I'm restricted to a display only 3 months wide. More
than one month is relatively easy to display from present but not
from some other point. It would seem that the 80 column display
still rules supreme - - - - - and that's on a 1920 pixel wide monitor.


It may be possible by sub-classing, to override 

[issue41449] An article on Python 3 stdout and stderr output buffering

2020-08-01 Thread tedder


Change by tedder :


--
nosy: +tedder

___
Python tracker 

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



Re: Python has stopped working

2020-08-01 Thread Chris Angelico
On Sun, Aug 2, 2020 at 1:00 PM Harsh Mashru  wrote:
>
>  Respected sir/ma'am
>
> I've been trying to execute the code which operates the
> camera. When it starts to open the camera it shows that  python.exe has
> stopped working.
>
> Problem signature:
>   Problem Event Name: APPCRASH
>   Application Name: python.exe
>   Fault Module Name: cv2.cp38-win_amd64.pyd

The actual crash happened inside this module. I'm guessing that's some
sort of camera handler. You may need to look into why *that* is
crashing.

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


Python has stopped working

2020-08-01 Thread Harsh Mashru
 Respected sir/ma'am

I've been trying to execute the code which operates the
camera. When it starts to open the camera it shows that  python.exe has
stopped working.

Problem signature:
  Problem Event Name: APPCRASH
  Application Name: python.exe
  Application Version: 3.8.5150.1013
  Application Timestamp: 5f15bf71
  Fault Module Name: cv2.cp38-win_amd64.pyd
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp: 5f028477
  Exception Code: c005
  Exception Offset: 02c6a90a
  OS Version: 6.1.7601.2.1.0.768.2
  Locale ID: 16393
  Additional Information 1: 221e
  Additional Information 2: 221ebc263cc5a862cc38c6e101bcabef
  Additional Information 3: 73ad
  Additional Information 4: 73ad4612db3d3535fc9083877169fc99

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288=0x0409

If the online privacy statement is not available, please read our privacy
statement offline:
  C:\Windows\system32\en-US\erofflps.txt

I look forward to hearing from you.

Regards,
Harsh Mashru
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-08-01 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue40979] typing module docs: keep text, add subsections

2020-08-01 Thread Luciano Ramalho

Luciano Ramalho  added the comment:

I have incorporated Guido's suggestions and added additional subsections to 
make it easier to navigate the page.

I also added notes that fix the issue https://bugs.python.org/issue40978 — 
"Document that typing.SupportsXXX protocols are runtime checkable"

--

___
Python tracker 

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



[issue40978] Document that typing.SupportsXXX protocols are runtime checkable

2020-08-01 Thread Luciano Ramalho


Luciano Ramalho  added the comment:

I have added a note about the protocols decorated with `@runtime_checkable` to 
the `Procools` section of the reorganized `typing.rst` in 
https://bugs.python.org/issue40979.

I also expanded the note about the caveats of `@runtime_checkable` in its entry 
in `Functions and decorators` section, giving `SupportsFloat` as an example 
issue.

--

___
Python tracker 

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



Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 7:24 PM o1bigtenor  wrote:
>
> On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list
>  wrote:
> >
> > On 01/08/2020 23:36, o1bigtenor wrote:
> > > On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list
> > > mailto:python-list@python.org>> wrote:
> > >
> > > On 31/07/2020 02:52, o1bigtenor wrote:
> > >  > I regularly work in planning through multiple years at once.
> > >  > This means that I like to have a lot of stuff available in a 
> > > calendar
> > >  > function.
snip
> > Let's start with the disappointing information:-
> > - please read https://docs.python.org/3/library/calendar.html and the
> > *function's* help:
> >
> >  >>> help(cal.calendar)
> > Help on method formatyear in module calendar:
> > formatyear(theyear, w=2, l=1, c=6, m=3) method of calendar.TextCalendar
> > instance
> >  Returns a year's calendar as a multi-line string.
> >
> > The word "year" is singular, and the parameters are all to do with the
> > output-presentation. We can't even request 'the rest of the year from
> > August onwards'!
>
> It is very disappointing - - - -suggests that thinking outside the space of
> one year is somehow deprecated. Frustrated when what you do demands
> that you think in longer periods of time (and yet have to function within
> the week as well).
>
> >
> > There are other helper functions. Also, we are invited to sub-class.
>
> Hmm - - - will have to investigate that.

Doing some searching - - - - sub-class really doesn't have a lot of 'official'
info. Perhaps an information source might be pointed out?
> >
> > Might it be possible to generate multiple year (or month) groups, split
> > them by line, and then reassemble line-by-line to produce the width and
> > temporal length required?
>
> Likely work well if the months were considered as discrete blocks.
> Thinking that one could have something like
>

> It is very useful for me to have the week numbers included. Have
> learned some fascinating things (some months have 6 weeks in
> them!) and the joys of formating (grin!).
> >
> > What do you think?
>
> I was starting from what I understood (how to print 'a' year) working
> to get closer to what I could use. Ncal allows me to display a
> calendar except I'm restricted to a display only 3 months wide. More
> than one month is relatively easy to display from present but not
> from some other point. It would seem that the 80 column display
> still rules supreme - - - - - and that's on a 1920 pixel wide monitor.
>
> Thanks for the ideas and suggestions!
>January 20xx  February 20xx
>   Su  Mo  Tu  We  Th  Fr  Sa Su  Mo  Tu  We  Th  Fr  Sa
> 1  1 2 3455   
>12
> 2 6 78 910  11  12   6 3 45 6  7  
>  89
> 313   14  15   16   17  18  19   710   11  12   13   14  15  16
> 420   21  22   23   24  25  26   8
> 527   28  29   30   31
>

Reading through more docs there is a possibility of using the 'format'
command. Would need to first come up with a way of describing the
months (with their attendant week numbers) and then describe a
formating system which would then enable a use of 'print' to achieve
the desired goal.

Is this perhaps a good way of doing this?

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


[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-08-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Okay, marking this as closed.

--
resolution:  -> works for me
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: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list
 wrote:
>
> On 01/08/2020 23:36, o1bigtenor wrote:
> > On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list
> > mailto:python-list@python.org>> wrote:
> >
> > On 31/07/2020 02:52, o1bigtenor wrote:
> >  > I regularly work in planning through multiple years at once.
> >  > This means that I like to have a lot of stuff available in a calendar
> >  > function.
> >  > Python seems to be locked when I need to display more than 1 year
> > at a
> >  > time.
> >  > I don't see a way to display something like 3 years worth of calendar
> >  > starting at a point 23 months from now.
> >  > (I see how to display 1 year at a time but not multiple years.)
> >
> > This question seems a little vague. How are you creating this "calendar
> > function"? Are you using the Python Standard Library calendar, or
> > perhaps talking about datetime calculations?
> >
> > Please copy-paste code showing this "lock".
> >
> >
> > Maybe its not a lock - - - - but there seems to be no way to display a
> > calendar starting
> > from a date that is 3 years in time frame.
> ...
>
> > I would like to show something like 2024 through the end of 2028.
>
>
> Let's start with the disappointing information:-
> - please read https://docs.python.org/3/library/calendar.html and the
> *function's* help:
>
>  >>> help(cal.calendar)
> Help on method formatyear in module calendar:
> formatyear(theyear, w=2, l=1, c=6, m=3) method of calendar.TextCalendar
> instance
>  Returns a year's calendar as a multi-line string.
>
> The word "year" is singular, and the parameters are all to do with the
> output-presentation. We can't even request 'the rest of the year from
> August onwards'!

It is very disappointing - - - -suggests that thinking outside the space of
one year is somehow deprecated. Frustrated when what you do demands
that you think in longer periods of time (and yet have to function within
the week as well).

>
> There are other helper functions. Also, we are invited to sub-class.

Hmm - - - will have to investigate that.
>
> Might it be possible to generate multiple year (or month) groups, split
> them by line, and then reassemble line-by-line to produce the width and
> temporal length required?

Likely work well if the months were considered as discrete blocks.
Thinking that one could have something like

   January 20xx  February 20xx
  Su  Mo  Tu  We  Th  Fr  Sa Su  Mo  Tu  We  Th  Fr  Sa
1  1 2 3455
 12
2 6 78 910  11  12   6 3 45 6
   7   89
313   14  15   16   17  18  19   710   11  12   13   14  15  16
420   21  22   23   24  25  26   8
527   28  29   30   31

It is very useful for me to have the week numbers included. Have
learned some fascinating things (some months have 6 weeks in
them!) and the joys of formating (grin!).
>
> What do you think?

I was starting from what I understood (how to print 'a' year) working
to get closer to what I could use. Ncal allows me to display a
calendar except I'm restricted to a display only 3 months wide. More
than one month is relatively easy to display from present but not
from some other point. It would seem that the 80 column display
still rules supreme - - - - - and that's on a 1920 pixel wide monitor.

Thanks for the ideas and suggestions!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread dn via Python-list

On 01/08/2020 23:36, o1bigtenor wrote:
On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list 
mailto:python-list@python.org>> wrote:


On 31/07/2020 02:52, o1bigtenor wrote:
 > I regularly work in planning through multiple years at once.
 > This means that I like to have a lot of stuff available in a calendar
 > function.
 > Python seems to be locked when I need to display more than 1 year
at a
 > time.
 > I don't see a way to display something like 3 years worth of calendar
 > starting at a point 23 months from now.
 > (I see how to display 1 year at a time but not multiple years.)

This question seems a little vague. How are you creating this "calendar
function"? Are you using the Python Standard Library calendar, or
perhaps talking about datetime calculations?

Please copy-paste code showing this "lock".


Maybe its not a lock - - - - but there seems to be no way to display a 
calendar starting

from a date that is 3 years in time frame.

...


I would like to show something like 2024 through the end of 2028.



Let's start with the disappointing information:-
- please read https://docs.python.org/3/library/calendar.html and the 
*function's* help:


>>> help(cal.calendar)
Help on method formatyear in module calendar:
formatyear(theyear, w=2, l=1, c=6, m=3) method of calendar.TextCalendar 
instance

Returns a year's calendar as a multi-line string.

The word "year" is singular, and the parameters are all to do with the 
output-presentation. We can't even request 'the rest of the year from 
August onwards'!


There are other helper functions. Also, we are invited to sub-class.

Might it be possible to generate multiple year (or month) groups, split 
them by line, and then reassemble line-by-line to produce the width and 
temporal length required?


What do you think?


Further web.refs:
Working with Python Calendar in Depth
https://www.pythonpool.com/python-calendar/

Python CALENDAR Tutorial with Example
https://www.guru99.com/calendar-in-python.html
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Non IDE development strategy - what do others do that's fairly simple?

2020-08-01 Thread Cameron Simpson
On 30Jul2020 21:15, Marco Sulla  wrote:
>What you want is a branch, I guess.
>
>https://www.mercurial-scm.org/wiki/Branch
>
>For simplicity, I suggest you have two different directories: one for the
>development branch and the other for the production branch.

Yes to this advice.

And I am also an editor in one window and command line in another window 
person.

Note that a Mercurial "named branch" is a more, um, "solid" thing than a 
git branch, which is much more like a mercurial bookmark. Basicly, you 
can't easily remove a mercurial named branch. Bookmarks you can make and 
discard freely. That said, I hardly ever use bookmarks.

You also do not need a named branch - a cloned directory works as well.

I use mercurial branches for long lived things, particularly development 
on theme. My personal library has a bunch of long term branches - they 
all get merged back into "default" frequently as things stabilise.

So for your scenario I'd add a named branch for the development, 
particularly if it has a theme. But also as Marco suggests, clone your 
tree into another directory for the development.

Look:

[~]fleet2*> cd ~/hg
/Users/cameron/hg
[~/hg]fleet2*> ls -d css-*
css-adzapper css-nodedb-nested-curly-syntax
css-aws  css-nodedb-proxyobjs
css-beyonwiz css-persist
css-calibre  css-pilfer
css-contractutilscss-pt
css-csbugcss-py3
[...]

Each of those trees is a clone of the main "css" tree. They do not all 
have named branches.

[~/hg]fleet2*> cd css
[~/hg/css(hg:default)]fleet2*> hg clone . ../css-newdev
[~/hg/css(hg:default)]fleet2*> cd ../css-newdev
[~/hg/css-newdev(hg:default)]fleet2*> hg branch newdev
[~/hg/css-newdev(hg:newdev)]fleet2*>

So now I've got a clone in css-newdev, for a new named branch "newdev" 
(obviously pick a better branch name). No need to make a named branch, 
unless this is long lived, in which case it helps you track where 
changes occurred - the branch name is recorded in commits.

You can merge to or from "../css" as needed.

I find this _much_ easier to deal with than the common git habit of 
switching branches in place (which you can also do).

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread William Ray Wing via Python-list

> On Aug 1, 2020, at 10:35 AM, o1bigtenor  wrote:
> 
> On Sat, Aug 1, 2020 at 9:29 AM o1bigtenor  wrote:
>> 
>>> On Sat, Aug 1, 2020 at 6:58 AM Peter Otten <__pete...@web.de> wrote:
>>> 
>>> o1bigtenor wrote:
>>> 
>>> import calendar
>>> print (calendar.calendar(2024,1,1,2,8))
>>> 
 I would like to show something like 2024 through the end of 2028.
>>> 
>>> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
>> 
>> 
>> Sorry - - - - 1st response was to only Mr Peter - - - hopefully this is
>> useful to more than I so here is that to all.
>>> 
>>> 
>> 
> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
>> Traceback (most recent call last):
>>  File "", line 1, in 
>>  File "", line 1, in 
>> NameError: name 'cd' is not defined
>> 
>> so 'cd' seems to be a problem.
>> 
>> Tried changing 'cd' to calendar and that gives the desired response.
>> 
>> Except its a neat 3 months wide very very very many rows of calendar.
>> 
>> I'm trying to figure out how to do something like this:
>> 
>>November 2022  December 2022
>>January 2023February 2023
>> March 2023April 2023
>> May 2023
>>   Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa  Su Mo Tu
>> We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
>> Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
>> 1231  2  3  4  5 127  1  2  3
>>132  1  2  3  4  5  6  7  136   1  2  3  4  140
>> 1  2  3  4  1441  149 1  2  3  4  5  6
>> 124  6  7  8  9 10 11 12  128  4  5  6  7  8  9 10  133  8  9 10 11 12
>> 13 14  137  5  6  7  8  9 10 11  141  5  6  7  8  9 10 11  145  2  3
>> 4  5  6  7  8  150  7  8  9 10 11 12 13
>> 125 13 14 15 16 17 18 19  129 11 12 13 14 15 16 17  134 15 16 17 18 19
>> 20 21  138 12 13 14 15 16 17 18  142 12 13 14 15 16 17 18  146  9 10
>> 11 12 13 14 15  151 14 15 16 17 18 19 20
>> 126 20 21 22 23 24 25 26  130 18 19 20 21 22 23 24  135 22 23 24 25 26
>> 27 28  139 19 20 21 22 23 24 25  143 19 20 21 22 23 24 25  147 16 17
>> 18 19 20 21 22  152 21 22 23 24 25 26 27
>> 127 27 28 29 30   131 25 26 27 28 29 30 31  136 29 30 31
>>   140 26 27 28  144 26 27 28 29 30 31 148 23 24
>> 25 26 27 28 29  153 28 29 30 31
>> 
>>   149 30
>> 
>>   June 2023 July 2023August 2023
>>   September 2023 October 2023
>> November 2023 December 2023
>>Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th
>> Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo
>> Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
>> 153  1  2  3  1571  1621  2  3
>> 4  5  166 1  2  171  1  2  3  4  5  6  7  175
>>  1  2  3  4  179 1  2
>> 
>> The formatting here is a mess.
> 
> (Its an even bigger mess now when its truncated to 80 columns. Can't change
> the mess but I can tell you that it doesn't 'look that way'! Don't know how to
> include an example in the body and have it be even a bit accurate - - - please
> advise if there is a way.)
> 

If you want us to see it in its exact form, print to PDF, post/share It on 
Dropbox. 

>> The months are centered. The week numbers are consecutive from the
>> starting date.
>> The dates are centered under the weekday name. If you've ever used
>> ncal its like that except
>> that I can now have up to 7 months wide if the terminal is wide enough
>> (>180 columns IIRC).
>> A mentor was working on this in Perl but as he died some couple months
>> ago its up to me
>> to make what I want.
>> Because it seems like there are a lot of disparate things happening
>> its not very straight
>> forward trying to replicate and extend my friend's efforts except in
>> Python. (My friend
>> preferred to work in Perl rather than Python and I'm wanting to learn
>> Python. I understand
>> that this is not perhaps the easiest way to learn something but it
>> sure is interesting!)
>> 
>> TIA
> -- 
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Downloading Python

2020-08-01 Thread MRAB

On 2020-08-01 21:58, Barry wrote:



On 1 Aug 2020, at 15:16, Luuk  wrote:



On 31-7-2020 22:10, Tanmay Shah wrote:
Hello to whoever this may concern,

After downloading Python 3.8.5 IDLE, an error message popped up, saying
the code execution cannot proceed because python38.dll was not found. What
should I do in order to use the Python interpreter?


I have never had to reboot windows when installing python.
Was I lucky?


No. I've never had a problem with it either.




Thank you!



It's WIndows, did you try to reboot ?

It seems to solve a lot of problems, on Windows


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


[issue41451] Cannot subclass typing.Generic with __weakref__ slot in Python 3.6

2020-08-01 Thread Ned Deily


Ned Deily  added the comment:

Thank you for the report and for the analysis. As you probably know, Python 3.6 
is now in the security phase of its life cycle so generally only fixes for 
security-related issues are provided at this point. This issue doesn't seem to 
fall into that category. If you have a workaround for 3.6.x, documenting it is 
probably the best available option. I'm going to close this as "wont fix".

https://www.python.org/downloads/

--
nosy: +ned.deily
resolution:  -> wont fix
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



Pythran 0.9.6 - talar tro

2020-08-01 Thread Serge Guelton
Hi folks, and sorry for the double posting if any,

It's my pleasure to share with you the 0.9.6 release of Pythran, code-named
talar-tro [0].

Pythran is a compiler for numerical kernels written in Python.
It doesn't require much type information and its inputs are 100% compatible with
the Python interpreter (but the other way around is not true!)

More than 6 months have passed since last revision, so the changelog is a bit
dense [1], but basically, that's the first release that only supports Python3 
[2],
I made quite a lot of changes in the expression engine and it comes with more
supported numpy stuff, hopefully less bugs etc.

As usual, it's available on Pypi, conda-forge and github :-)


[0] https://br.wikipedia.org/wiki/Talar-tro
[1] https://pythran.readthedocs.io/en/latest/Changelog.html
[2] Is that even a feature?
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-08-01 Thread Tim Peters


Tim Peters  added the comment:

That text is fine, if you feel something needs to be said at all. I really 
don't. A Pareto distribution of this kind with parameter <= 1.0 has infinite 
expected value - VERY long tail. Anyone who knows what they're doing already 
knows that. The reason the implementation can't "blow up" for parameters >= 
(roughly) 0.1 isn't that IEEE doubles have such a large dynamic range but 
rather that they can't represent a number < 1.0 larger than 1 - 2**-53 (so u = 
1 - random.random() is always at least 2**-53). The actual distribution has 
infinite expected value nonetheless, but the implementation is incapable of 
generating any of its very large values (which, while very rare, are also very 
large).

--

___
Python tracker 

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



Re: Downloading Python

2020-08-01 Thread Barry


> On 1 Aug 2020, at 15:16, Luuk  wrote:
> 
> 
>> On 31-7-2020 22:10, Tanmay Shah wrote:
>> Hello to whoever this may concern,
>> 
>> After downloading Python 3.8.5 IDLE, an error message popped up, saying
>> the code execution cannot proceed because python38.dll was not found. What
>> should I do in order to use the Python interpreter?

I have never had to reboot windows when installing python.
Was I lucky?

Barry

>> 
>> Thank you!
> 
> 
> It's WIndows, did you try to reboot ?
> 
> It seems to solve a lot of problems, on Windows
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

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


[issue41075] IDLE: Better support history navigation

2020-08-01 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +epaine

___
Python tracker 

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



[issue41075] IDLE: Better support history navigation

2020-08-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Yes, history works fine with the current bindings to alt-p and alt-n, or with 
binding to up or down, but not with binding to modifier-up/down.

--

___
Python tracker 

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



[issue41075] IDLE: Better support history navigation

2020-08-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

History and up/down is apart of #2704.  It has patches that include the up/down 
change, but I don't expect to use any of them as they are.

I tried Shift/Control/Alt - Up/Down and none worked.  Rebinding just Up/Down 
did (in Shell only, leaving up/down unchanged in Editor).  But not having 
up/down work to move between lines in the Shell multiline statement entry area 
is not acceptable to me.  I don't know if modifiers can never work with up/down 
or if there is something that would make it work.

--
nosy:  -epaine
stage: resolved -> 
status: closed -> open
title: Make support of navigating through prev. commands in IDLE more 
conspicuous -> IDLE: Better support history navigation
versions:  -Python 3.8, Python 3.9

___
Python tracker 

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



[issue2704] IDLE: Patch to make PyShell behave more like a Terminal interface

2020-08-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#41075 is specifically about history navigation.  I tried Shift/Control/Alt - 
Up/Down and none worked.  Rebinding just Up/Down did (in Shell, with Editor 
unchanged).  But not having up/down work to move between lines in the Shell 
multiline statement entry area is not acceptable to me.  Two additional idea 
from the new issue: a) Add history commands to context menu to make them more 
discoverable; b) When statement has SyntaxError, put Error message in box and 
let user edit bad code directly, as in Editor.

--

___
Python tracker 

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



[issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes

2020-08-01 Thread Johannes Reiff


Johannes Reiff  added the comment:

Thanks! Is there anything I need to do regarding the Python 3.8 and 3.9 
backports?

--

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-08-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

How about this wording?

If alpha is smaller than 0.1, an occasional OverflowError can
arise when the variate exceeds the range of Python float.

I like using 0.1 because it's easy and gives us some wiggle room.  The actual 
cutoff is lower:

>>> alpha = 0.05079
>>> sys.float_info.epsilon ** (-1.0 / alpha)

>>> alpha = 0.05078
>>> sys.float_info.epsilon ** (-1.0 / alpha)
Traceback (most recent call last):
   File "", line 1, in 
 sys.float_info.epsilon ** (-1.0 / alpha)
1.590779741838475e+308

--

___
Python tracker 

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



[issue41455] Python Devguide differs from python docs

2020-08-01 Thread Yaroslac


New submission from Yaroslac :

As I can see here 
https://github.com/python/devguide/blob/master/garbage_collector.rst#collecting-the-oldest-generation

> the GC only triggers a full collection of the oldest generation if the ratio 
> long_lived_pending / long_lived_total is above a given value (hardwired to 
> 25%)

But in the python docs here 
https://docs.python.org/3.10/library/gc.html#gc.set_threshold

> When the number of allocations minus the number of deallocations exceeds 
> threshold0, collection starts. Initially only generation 0 is examined. If 
> generation 0 has been examined more than threshold1 times since generation 1 
> has been examined, then generation 1 is examined as well. Similarly, 
> threshold2 controls the number of collections of generation 1 before 
> collecting generation 2.

So, which one is correct?

--
assignee: docs@python
components: Documentation
messages: 374665
nosy: Yaroslav, docs@python
priority: normal
severity: normal
status: open
title: Python Devguide differs from python docs
type: resource usage
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



Re: Downloading Python

2020-08-01 Thread Bischoop
On 2020-07-31, Stefan Ram  wrote:
>
>   Don't download just IDLE in isolation.
>
>   Instead download Python 3.8 from www.python.org/downloads
>   and properly install it following the installation
>   instructions for your operating system.
>
>   This will then include IDLE.
>
>

He's right.

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


Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 9:29 AM o1bigtenor  wrote:
>
> On Sat, Aug 1, 2020 at 6:58 AM Peter Otten <__pete...@web.de> wrote:
> >
> > o1bigtenor wrote:
> >
> >  import calendar
> >  print (calendar.calendar(2024,1,1,2,8))
> >
> > > I would like to show something like 2024 through the end of 2028.
> >
> > print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
>
>
> Sorry - - - - 1st response was to only Mr Peter - - - hopefully this is
> useful to more than I so here is that to all.
> >
> >
>
> >>> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "", line 1, in 
> NameError: name 'cd' is not defined
>
> so 'cd' seems to be a problem.
>
> Tried changing 'cd' to calendar and that gives the desired response.
>
> Except its a neat 3 months wide very very very many rows of calendar.
>
> I'm trying to figure out how to do something like this:
>
> November 2022  December 2022
> January 2023February 2023
> March 2023April 2023
> May 2023
>Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa  Su Mo Tu
> We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
> Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
> 1231  2  3  4  5 127  1  2  3
> 132  1  2  3  4  5  6  7  136   1  2  3  4  140
> 1  2  3  4  1441  149 1  2  3  4  5  6
> 124  6  7  8  9 10 11 12  128  4  5  6  7  8  9 10  133  8  9 10 11 12
> 13 14  137  5  6  7  8  9 10 11  141  5  6  7  8  9 10 11  145  2  3
> 4  5  6  7  8  150  7  8  9 10 11 12 13
> 125 13 14 15 16 17 18 19  129 11 12 13 14 15 16 17  134 15 16 17 18 19
> 20 21  138 12 13 14 15 16 17 18  142 12 13 14 15 16 17 18  146  9 10
> 11 12 13 14 15  151 14 15 16 17 18 19 20
> 126 20 21 22 23 24 25 26  130 18 19 20 21 22 23 24  135 22 23 24 25 26
> 27 28  139 19 20 21 22 23 24 25  143 19 20 21 22 23 24 25  147 16 17
> 18 19 20 21 22  152 21 22 23 24 25 26 27
> 127 27 28 29 30   131 25 26 27 28 29 30 31  136 29 30 31
>140 26 27 28  144 26 27 28 29 30 31 148 23 24
> 25 26 27 28 29  153 28 29 30 31
>
>149 30
>
>June 2023 July 2023August 2023
>September 2023 October 2023
> November 2023 December 2023
> Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th
> Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo
> Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
> 153  1  2  3  1571  1621  2  3
>  4  5  166 1  2  171  1  2  3  4  5  6  7  175
>   1  2  3  4  179 1  2
>
> The formatting here is a mess.

(Its an even bigger mess now when its truncated to 80 columns. Can't change
the mess but I can tell you that it doesn't 'look that way'! Don't know how to
include an example in the body and have it be even a bit accurate - - - please
advise if there is a way.)

> The months are centered. The week numbers are consecutive from the
> starting date.
> The dates are centered under the weekday name. If you've ever used
> ncal its like that except
> that I can now have up to 7 months wide if the terminal is wide enough
> (>180 columns IIRC).
> A mentor was working on this in Perl but as he died some couple months
> ago its up to me
> to make what I want.
> Because it seems like there are a lot of disparate things happening
> its not very straight
> forward trying to replicate and extend my friend's efforts except in
> Python. (My friend
> preferred to work in Perl rather than Python and I'm wanting to learn
> Python. I understand
> that this is not perhaps the easiest way to learn something but it
> sure is interesting!)
>
> TIA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 6:58 AM Peter Otten <__pete...@web.de> wrote:
>
> o1bigtenor wrote:
>
>  import calendar
>  print (calendar.calendar(2024,1,1,2,8))
>
> > I would like to show something like 2024 through the end of 2028.
>
> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))


Sorry - - - - 1st response was to only Mr Peter - - - hopefully this is
useful to more than I so here is that to all.
>
>

>>> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
NameError: name 'cd' is not defined

so 'cd' seems to be a problem.

Tried changing 'cd' to calendar and that gives the desired response.

Except its a neat 3 months wide very very very many rows of calendar.

I'm trying to figure out how to do something like this:

November 2022  December 2022
January 2023February 2023
March 2023April 2023
May 2023
   Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa  Su Mo Tu
We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
1231  2  3  4  5 127  1  2  3
132  1  2  3  4  5  6  7  136   1  2  3  4  140
1  2  3  4  1441  149 1  2  3  4  5  6
124  6  7  8  9 10 11 12  128  4  5  6  7  8  9 10  133  8  9 10 11 12
13 14  137  5  6  7  8  9 10 11  141  5  6  7  8  9 10 11  145  2  3
4  5  6  7  8  150  7  8  9 10 11 12 13
125 13 14 15 16 17 18 19  129 11 12 13 14 15 16 17  134 15 16 17 18 19
20 21  138 12 13 14 15 16 17 18  142 12 13 14 15 16 17 18  146  9 10
11 12 13 14 15  151 14 15 16 17 18 19 20
126 20 21 22 23 24 25 26  130 18 19 20 21 22 23 24  135 22 23 24 25 26
27 28  139 19 20 21 22 23 24 25  143 19 20 21 22 23 24 25  147 16 17
18 19 20 21 22  152 21 22 23 24 25 26 27
127 27 28 29 30   131 25 26 27 28 29 30 31  136 29 30 31
   140 26 27 28  144 26 27 28 29 30 31 148 23 24
25 26 27 28 29  153 28 29 30 31

   149 30

   June 2023 July 2023August 2023
   September 2023 October 2023
November 2023 December 2023
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th
Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo
Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
153  1  2  3  1571  1621  2  3
 4  5  166 1  2  171  1  2  3  4  5  6  7  175
  1  2  3  4  179 1  2

The formatting here is a mess.
The months are centered. The week numbers are consecutive from the
starting date.
The dates are centered under the weekday name. If you've ever used
ncal its like that except
that I can now have up to 7 months wide if the terminal is wide enough
(>180 columns IIRC).
A mentor was working on this in Perl but as he died some couple months
ago its up to me
to make what I want.
Because it seems like there are a lot of disparate things happening
its not very straight
forward trying to replicate and extend my friend's efforts except in
Python. (My friend
preferred to work in Perl rather than Python and I'm wanting to learn
Python. I understand
that this is not perhaps the easiest way to learn something but it
sure is interesting!)

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


Re: Downloading Python

2020-08-01 Thread Luuk



On 31-7-2020 22:10, Tanmay Shah wrote:

Hello to whoever this may concern,

After downloading Python 3.8.5 IDLE, an error message popped up, saying
the code execution cannot proceed because python38.dll was not found. What
should I do in order to use the Python interpreter?

Thank you!



It's WIndows, did you try to reboot ?

It seems to solve a lot of problems, on Windows

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


[issue41454] while loop bug on list

2020-08-01 Thread Dexter Ramos


Dexter Ramos  added the comment:

Thank you Mr. Erick Smith. Now I know. I also tried to find the hard way like 
this:

finding nemo-
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4] --->index
[4, 1, 2, 5, 7, 4, 2, 8, 9, 5, 3, 2, 4, 6] --->original list
 / --->started at index 0 with value of 
4
[1, 2, 5, 7, 2, 8, 9, 5, 3, 2, 6, 4] --->1st iteration, all 4's are removed 
then appended so the index adjusted
/--->next at index 1 with a value of 2 
(whereas value 1 was skipped which had index 1 originally; this is not seen on 
the output because it has no duplicate)
[1, 5, 7, 8, 9, 5, 3, 6, 4, 2] --->3rd iteration
   / --->next at index 2 with value of 7; value 
5 was skipped which had the index 2 originally; cause found!
[1, 5, 8, 9, 5, 3, 6, 4, 2, 7] --->4th ...
...
---nemo found---
Credits to you.

Here is the new working code:
---code
bunchofnumbers = [4, 1, 2, 5, 7, 4, 2, 8, 9, 5, 3, 2, 4, 6]
for eachnumber in bunchofnumbers.copy():
while eachnumber in bunchofnumbers:
bunchofnumbers.remove(eachnumber)
bunchofnumbers.append(eachnumber)
bunchofnumbers.sort()
---end of code-
OUTPUT:
[1, 2, 3, 4, 5, 6, 7, 8, 9]
print(bunchofnumbers)

--

___
Python tracker 

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



XanaNews Statistic for comp.lang.python. 8/1/2020 7:48:48 AM [1/2]

2020-08-01 Thread The Doctor via Python-list
XanaNews Statistic for comp.lang.python.  8/1/2020 7:48:48 AM

>From article 581998 (7/1/2020 6:44:35 AM) to article 582636 (7/31/2020
8:24:06 PM)

Number of threads  ... 318
Number of articles  .. 674
Average articles per thread  . 2.12
Number of unanswered posts  .. 245
Number of posts from XanaNews users .. 0


Top Threads

Ranking  Articles  Subject
---    --
  137  Formal Question to Steering Council (re recent PEP8
changes)
  228  Bulletproof json.dump?
  316  Fwd: [BUG] missing ')' causes syntax error on next
line
  414  Iterators, iterables and special objects
  512  frozendict: an experiment
  611  Symlinks already present
  710  Questioning the effects of multiple assignment
  8 9  "1,+2,", but not "(1,)+2,"
  9 9  EuroPython 2020: Data Science Track
 10 8  Installing Python 3.8.3 with tkinter
 11 8  The speed of glob()
 12 8  Python Program Help
 13 8  Re: Friday Finking: Limiting parameters
 14 8  Winreg
 15 7  Request help w/pip install jq
 16 7  True is True / False is False?
 17 7  Confused about np.polyfit()
 18 7  An I connected here?
 19 6  Need to 'import gtk' on Ubuntu 20.04, what do I need?
 20 6  Re: Dowloading package dependencies from locked down
machine
 21 6  RE: Local access to a file, How To ?
 22 6  Fake news Detect
 23 6  help
 24 6  A rule for your twitlist/mailing list
 25 6  Issues in downloading python
 26 5  Python pandas Excel
 27 5  python software foundation
 28 5  Dowloading package dependencies from locked down
machine
 29 5  why is requests 2.24 behaving differently on
different Win10Pro PCs?
 30 5  How to diagnose import error when importing from .so
file?
 31 5  Access last element after iteration
 32 5  trying to improve my knn algorithm
 33 5  Iterating over dict is slower than iterating over
iter(dict)?
 34 5  New to python - Just a question
 35 5  Friday Finking: Limiting parameters
 36 5  Need a Dynamic vlookup using python
 37 5  Winreg
 38 4  Unable to login | fbchat.Client
 39 4  Issues Download the Latest Version of Python
Programming Language
 40 4  Is sys.executable not supposed to follow symlinks?
 41 4  Windows and Subclassing - 'OverflowError': int too
long to convert
 42 4  How to limit *length* of PrettyPrinter
 43 4  Re: frozendict: an experiment
 44 4  Facing problem while opening phython
 45 4  Python Scripts
 46 4  python installation help
 47 4  Re: Assign Excel cell value from Datepicker widget
Selection using Python
 48 3  "OSError: [Errno 9] Bad file descriptor" When I try
to Install the library in conda prompt
 49 3  Equivalent of "make install" for Python on windows?
 50 3  python software foundation
 51 3  Upgrade from Python 3.6 to 3.8 and cx-freeze is not
available more
 52 3  Re: How to read barcoded value from PDF
 53 3  execution timing of the method QWidget.show()
 54 3  Typing modules
 55 3  Re: How to limit *length* of PrettyPrinter
 56 3  Support both asyncio and synchronous callers
 57 3  Re: Solutions, Testbank for Labor Economics 8th
Edition, 8e by George Borjas
 58 3  Urgent
 59 3  Re: solution manual for Operating System Concepts
9th Edition by Abraham
 60 3  Very Simple (Rather Dumb) Question
 61 3  PEP 622
 62 3  What's the enum for a button press event in
pygobject 3?
 63 3  How to find code that causes a 'deprecated' warning?
 64 3  Non IDE development strategy - what do others do
that's fairly simple?
 65 3  Issue with Python installation for a beginner Python
coder.
 66 3  App for Moto e6 using Python?
 67 3  Re: Seeking to convert a py timer app for my Moto E6
 68 3  Gtk.TextBuffer problem on converting from GTK+ 2 to
GTK+ 3
 69 2  excel (multiple sheets) to yml file for each sheet
 70 2  Downloading Python
 71 2  Re: FW: Pycharm Won't Do Long Underscore
 72 2  questions re: calendar module
 73 2  business analysis and valuation IFRS edition 5th
edition by Palepu Solution manual


Top Posters

Ranking  Articles  NameMost Used Newsreader
---    --  
  1   119  Vagrant   

XanaNews Statistic for comp.lang.python. 8/1/2020 7:48:48 AM [2/2]

2020-08-01 Thread The Doctor via Python-list
 87 1  Mathiyazhagan S  
 88 1  Elias Fotinis   Mozilla  
 89 1  ??? Gnus 
 90 1  Oscar Benjamin   
 91 1  Wasdeq68 
 92 1  Robin BeckerMozilla  
 93 1  dadmomsa...@gmail.com   G2   
 94 1  nama...@gmail.com   G2   
 95 1  Sarvesh Poddar  WebService   
 96 1  Sumana HarihareswaraMozilla  
 97 1  mentific...@gmail.com   G2   
 98 1  nhpythonOpen-Xchange Mailer  
 99 1  Bob7starMozilla  
100 1  David L NeilMozilla  
101 1  boB Stepp
102 1  BartMozilla  
103 1  Tanmay Shah  
104 1  R.WieserMicrosoft Outlook Express
105 1  Danilo Coccia   Mozilla  
106 1  Damian Johnson   
107 1  Liste guru  Mozilla  
108 1  Stephen Carboni  
109 1  Bolun Thompson   
110 1  kyroha...@gmail.com G2   
111 1  hunter.hammond.dev@gmail.c  G2   
112 1  Raine Pretorius  
113 1  Romulus Schilling
114 1  LUIGI BISIGNANI:MAI PIU' C  G2   
115 1  WingwarePostbox  
116 1  artis.pain...@gmail.com G2   
117 1  Nomen NescioUnison   
118 1  nhes...@gmail.com   G2   
119 1  farabia...@gmail.comG2   
120 1  Jim Mozilla  
121 1  Michio Suginoo   
122 1  joserivera6...@gmail.comG2   
123 1  Vincent Davis
124 1  Chaitanya Patil  
125 1  Ralf M. Mozilla  
126 1  anisaqeela...@gmail.com G2   
127 1  Shivam Dutt Sharma   
128 1  Bob Gailer   
129 1  Christman, Roger Graydon 
130 1  Damilare 
131 1  haris@gmail.com G2   
132 1  Bischoopslrn 
133 1  Deepak Didmania  
134 1  MICHELE CALZOLARI IGEA BAN  G2   
135 1  Ed Walser
136 1  vjp2.at@at.BioStrategist.d  tin  
137 1  rami.chowdh...@gmail.comgeary
138 1  mahabub.cse.b...@gmail.com  G2   
139 1  Stephan Lukits  iPhone Mail (
140 1  ksiko...@yahoo.com  G2   
141 1  Richard Damon   Mozilla  
142 1  kandolacherrydeepkaur@gmai  G2   
143 1  Stephen Rosen
144 1  Gazuslrn 
145 1  Shanmika Sugavaneswaran  
146 1  Bill Deegan  
147 1  J Conrado   Mozilla  
148 1  CMCC Info   Mozilla  
149 1  Reto 
150 1  Orges Leka   
151 1  Abhiram R
152 1  xuanwu348   Coremail Webmail Server V


Top Newsreaders

Ranking  Articles  NewsreaderUsers
---      -
  1   238  

[issue41454] while loop bug on list

2020-08-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

You're mutating the list while iterating over it, which is causing the behavior 
you're seeing. This isn't a bug.

See for example 
https://stackoverflow.com/questions/6260089/strange-result-when-removing-item-from-a-list

Also, when reporting bugs in the future, please include the output you got, and 
how it differs from what you expected. It's difficult to guess.

--
nosy: +eric.smith
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



[issue41451] Cannot subclass typing.Generic with __weakref__ slot in Python 3.6

2020-08-01 Thread Joshua Bronson


Joshua Bronson  added the comment:

Thanks so much, @oremanj! Indeed, merely subscripting the class triggers the 
bug, and your 'del slots' workaround does the trick!

For completeness, there is an updated (yet more minimal) repro below/attached.


"""Repro for Python 3.6 slots + weakref + typing.Generic subclass bug."""

from typing import Generic, TypeVar
from weakref import ref


T = TypeVar("T")

class MyGeneric(Generic[T]):
"""MyGeneric works as expected.

>>> example = MyGeneric()
>>> example
<__main__.MyGeneric object at ...>
>>> example._other
<__main__.MyGeneric object at ...>
>>> example._other._other

>>> from pickle import dumps, loads
>>> pickled = dumps(example)
>>> roundtripped = loads(pickled)
>>> roundtripped
<__main__.MyGeneric object at ...>

"""

__slots__ = ("_other", "__weakref__")

def __init__(self) -> None:
self._init_other()

def _init_other(self) -> None:
other = self.__class__.__new__(self.__class__)
other._other = ref(self)
self._other = other

def __getstate__(self) -> dict:
"""Needed to enable pickling due to use of __slots__ and weakrefs."""
return {}

def __setstate__(self, _) -> None:
"""Needed because use of __slots__ would prevent unpickling 
otherwise."""
self._init_other()


# Merely the following is enough to trigger the bug on Python 3.6:
MyGeneric[T]

# This works around the issue if run first (thanks @oremanj):
del MyGeneric.__slots__  # does not actually 'unslot' the class


if __name__ == "__main__":
import doctest
doctest.testmod(optionflags=doctest.ELLIPSIS)

--
Added file: https://bugs.python.org/file49357/bpo41451-repro-min+workaround.py

___
Python tracker 

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



[issue41454] while loop bug on list

2020-08-01 Thread Dexter Ramos


New submission from Dexter Ramos :

The output should have no duplicates but it has. When I added another "5" on 
the list it goes okay and is still okay if I add more. But when there is only 
two 5's it won't do its job.

--
components: Windows
files: app.py
messages: 374661
nosy: Dexter Ramos, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: while loop bug on list
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49356/app.py

___
Python tracker 

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



Pygobject style question

2020-08-01 Thread Chris Green
Having (after lots of help from here, thank you) finally converted my
Python 2, gtk 2 program to Python 3 and pygobject gtk 3 I'm left with
a couple of what might be called style questions.

I guess it's mostly down to what feels right to me but there may be
good reasons for choosing one way over another and, if so, I'd like to
know what they are.

So, my original code had:-

...
...
self.buffer = gtk.TextBuffer()
self.view = gtk.TextView(self.buffer)
...
...


This doesn't work in gtk+ 3 (or at least I don't think it does, the
converter script changed it) and there seem to be several ways of
doing it now:-

...
...
self.buffer = Gtk.TextBuffer()
self.view = Gtk.TextView(buffer = self.buffer)
...
...


...
...
self.buffer = Gtk.TextBuffer()
self.view = Gtk.TextView.new_with_buffer(self.buffer)
...
...


...
...
self.view = Gtk.TextView()
self.buffer = self.view.get_buffer()
...
...


...
...
self.view = Gtk.TextView()
self.buffer = Gtk.TextBuffer()
self.view.set_buffer(self.buffer)
...
...

Is there any reason to prefer any one of the above over the others?

Obviously the last one is a line more but lends itself to using
several Gtk.TextBuffer objects in on Gtk.TextView.

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread Peter Otten
o1bigtenor wrote:

 import calendar
 print (calendar.calendar(2024,1,1,2,8))

> I would like to show something like 2024 through the end of 2028.

print("\n".join(cd.calendar(year) for year in range(2024, 2029)))


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


[issue29269] test_socket failing in solaris

2020-08-01 Thread Dennis Clarke


Dennis Clarke  added the comment:

Well here we are in 2020 and Solaris systems are still running just fine. In 
fact, some big Fujitsu SPARC systems are running in production for years and 
years and also, no surprise, this test still fails horrifically on old stable 
Solaris 10. Python is turning into a piece of supposedly open source software 
with many commercial interests with their hands inside of it. I am not sure how 
to get this bug fixed but I can certainly report that it is still broken in 
3.7.8 on a very stable and reliable platform.

--
nosy: +blastwave
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list 
wrote:

> On 31/07/2020 02:52, o1bigtenor wrote:
> > I regularly work in planning through multiple years at once.
> > This means that I like to have a lot of stuff available in a calendar
> > function.
> > Python seems to be locked when I need to display more than 1 year at a
> > time.
> > I don't see a way to display something like 3 years worth of calendar
> > starting at a point 23 months from now.
> > (I see how to display 1 year at a time but not multiple years.)
>
> This question seems a little vague. How are you creating this "calendar
> function"? Are you using the Python Standard Library calendar, or
> perhaps talking about datetime calculations?
>
> Please copy-paste code showing this "lock".
>

Maybe its not a lock - - - - but there seems to be no way to display a
calendar starting
from a date that is 3 years in time frame.

 python3
Python 3.7.7 (default, Apr  1 2020, 13:48:52)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import calendar
>>> print (calendar.calendar(2024,1,1,2,8))

 2024

  January   February   March
 April  May   June  July
 August
Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We
Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa
Su  Mo Tu We Th Fr Sa Su
 1  2  3  4  5  6  71  2  3  4   1  2  3   1  2  3
4  5  6  7 1  2  3  4  5  1  2   1  2  3  4  5  6
71  2  3  4
 8  9 10 11 12 13 14   5  6  7  8  9 10 11   4  5  6  7  8  9 10   8  9 10
11 12 13 14   6  7  8  9 10 11 12   3  4  5  6  7  8  9   8  9 10 11 12 13
14   5  6  7  8  9 10 11
15 16 17 18 19 20 21  12 13 14 15 16 17 18  11 12 13 14 15 16 17  15 16 17
18 19 20 21  13 14 15 16 17 18 19  10 11 12 13 14 15 16  15 16 17 18 19 20
21  12 13 14 15 16 17 18
22 23 24 25 26 27 28  19 20 21 22 23 24 25  18 19 20 21 22 23 24  22 23 24
25 26 27 28  20 21 22 23 24 25 26  17 18 19 20 21 22 23  22 23 24 25 26 27
28  19 20 21 22 23 24 25
29 30 31  26 27 28 29   25 26 27 28 29 30 31  29 30
 27 28 29 30 3124 25 26 27 28 29 30  29 30 31
26 27 28 29 30 31

 September  October   November
December
Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We
Th Fr Sa Su
   1  1  2  3  4  5  6   1  2  3
 1
 2  3  4  5  6  7  8   7  8  9 10 11 12 13   4  5  6  7  8  9 10   2  3  4
5  6  7  8
 9 10 11 12 13 14 15  14 15 16 17 18 19 20  11 12 13 14 15 16 17   9 10 11
12 13 14 15
16 17 18 19 20 21 22  21 22 23 24 25 26 27  18 19 20 21 22 23 24  16 17 18
19 20 21 22
23 24 25 26 27 28 29  28 29 30 31   25 26 27 28 29 30 23 24 25
26 27 28 29
3030 31


I would like to show something like 2024 through the end of 2028.

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


[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-08-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 5c3270939c09e4c8e80fd26449b718a998701912 by Raymond Hettinger in 
branch 'master':
bpo-41421: Algebraic simplification for random.paretovariate() (GH-21695)
https://github.com/python/cpython/commit/5c3270939c09e4c8e80fd26449b718a998701912


--

___
Python tracker 

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



[issue41447] Resource Tracker in Multiprocessing Shared Memory not working correctly

2020-08-01 Thread Ned Deily


Change by Ned Deily :


--
nosy: +davin, pitrou

___
Python tracker 

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



Re: questions re: calendar module

2020-08-01 Thread dn via Python-list

On 31/07/2020 02:52, o1bigtenor wrote:

I regularly work in planning through multiple years at once.
This means that I like to have a lot of stuff available in a calendar
function.
Python seems to be locked when I need to display more than 1 year at a
time.
I don't see a way to display something like 3 years worth of calendar
starting at a point 23 months from now.
(I see how to display 1 year at a time but not multiple years.)


This question seems a little vague. How are you creating this "calendar 
function"? Are you using the Python Standard Library calendar, or 
perhaps talking about datetime calculations?


Please copy-paste code showing this "lock".
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


[issue41445] Adding configure temporary files to gitignore

2020-08-01 Thread fj92f3jj923f923


fj92f3jj923f923  added the comment:

Closing it as not important :)

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



[issue41452] Inefficient BufferedReader.read(-1)

2020-08-01 Thread Ma Lin


Ma Lin  added the comment:

Some underlying stream has fast-path for .readall().
So close this issue.

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