[RELEASE] Python 3.14.0 alpha 1 is now available

2024-10-16 Thread Hugo van Kemenade via Python-list
It's now time for a new alpha of a new version of Python! https://www.python.org/downloads/release/python-3140a1/ **This is an early developer preview of Python 3.14** # Major new features of the 3.14 series, compared to 3.13 Python 3.14 is still in development. This release, 3.14.0a1 is the fi

[RELEASE] Python 3.13.0 release candidate 1 released

2024-08-01 Thread Thomas Wouters via Python-list
Python 3.13 *release candidate 1* is now available. https://www.python.org/downloads/release/python-3130rc1/ <https://discuss.python.org/t/python-3-13-0-release-candidate-1-released/59703#p-181511-this-is-the-first-release-candidate-of-python-3130-1>This is the first release candidate of

Re: Cprod -- (writing this: itertools.product([0, 1], repeat=N )

2024-05-22 Thread HenHanna via Python-list
dn wrote: On 22/05/24 07:14, HenHanna via Python-list wrote: How can i write this function Cprod (Cartesian Product) simply?     (writing this out: itertools.product([0, 1], repeat=N ) The value can be a list or a Tuple.     cprod([0, 1], 1) => ((0)

Re: Cprod -- (writing this: itertools.product([0, 1], repeat=N )

2024-05-21 Thread dn via Python-list
On 22/05/24 07:14, HenHanna via Python-list wrote: How can i write this function Cprod (Cartesian Product) simply?     (writing this out: itertools.product([0, 1], repeat=N ) The value can be a list or a Tuple.     cprod([0, 1], 1) => ((0)

Cprod -- (writing this: itertools.product([0, 1], repeat=N )

2024-05-21 Thread HenHanna via Python-list
How can i write this function Cprod (Cartesian Product) simply? (writing this out: itertools.product([0, 1], repeat=N ) The value can be a list or a Tuple. cprod([0, 1], 1) => ((0) (1)) cprod([0, 1], 2) => ((0,0) (0,1) (1,0) (1,1))

[RELEASE] Python 3.13.0 beta 1 released

2024-05-08 Thread Thomas Wouters via Python-list
After a little bit of excitement discovering new bugs during the release, *it’s done*: 3.13.0 beta 1 is released, the 3.13 branch has been created, and features for 3.13 are frozen! The main branch is now 3.14.0a0. https://www.python.org/downloads/release/python-3130b1/ *This is a beta preview of

Python 3.13.0 alpha 1 now available.

2023-10-13 Thread Thomas Wouters via Python-list
It’s not a very exciting release (yet), but it’s time for the first alpha of Python 3.13 anyway! https://www.python.org/downloads/release/python-3130a1/ *This is an early developer preview of Python 3.13* <https://discuss.python.org/t/python-3-13-0-alpha-1/36109#major-new-features-of-the-

[RELEASE] Python 3.12.0 release candidate 1 released

2023-08-06 Thread Thomas Wouters via Python-list
from this point forward in the 3.12 series, and the goal is that there will be as few code changes as possible. <https://discuss.python.org/t/python-3-12-0-release-candidate-1-released/31137#call-to-action-2>Call to action We strongly encourage maintainers of third-party Python projects to pr

Re: [RELEASE] Python 3.12.0 beta 1 released.

2023-05-25 Thread Robin Becker
On 25/05/2023 12:23, Robin Becker wrote: On 22/05/2023 22:04, Thomas Wouters wrote: > I'm pleased to announce the release of Python 3.12 beta 1 (and feature > freeze for Python 3.12). > ... I see a major difference between 3.12.0a7 and 3.12.0b1 Basically in preppy an impor

Re: [RELEASE] Python 3.12.0 beta 1 released.

2023-05-25 Thread Robin Becker
On 22/05/2023 22:04, Thomas Wouters wrote: > I'm pleased to announce the release of Python 3.12 beta 1 (and feature > freeze for Python 3.12). > ... I see a major difference between 3.12.0a7 and 3.12.0b1 Basically in preppy an importer is defined to handle imports of '

[RELEASE] Python 3.12.0 beta 1 released.

2023-05-22 Thread Thomas Wouters
I'm pleased to announce the release of Python 3.12 beta 1 (and feature freeze for Python 3.12). https://www.python.org/downloads/release/python-3120b1/ This is a beta preview of Python 3.12 Python 3.12 is still in development. This release, 3.12.0b1, is the first of four planned beta re

Re: Editing PEP-8, in particular "expected 2 blanks, found 1

2023-05-03 Thread Roy Hann
Kevin M. Wilson wrote: > Folks, help please! What the @#$! are these doing popping up. Code styles are > personal, and not subject to debate. [snip] "Expected 2 blanks"? Or "Expected 2 blank _lines_"? Two blank lines between function/method definitions has been recommended for more than 20 year

Re: Editing PEP-8, in particular "expected 2 blanks, found 1

2023-05-02 Thread Thomas Passin
On 5/2/2023 4:39 PM, Kevin M. Wilson via Python-list wrote: Folks, help please! What the @#$! are these doing popping up. Code styles are personal, and not subject to debate.Where can I edit these out of my IDE? Kevin "When you pass through the waters, I will be with you: and when you pass throu

Re: Editing PEP-8, in particular "expected 2 blanks, found 1

2023-05-02 Thread 2QdxY4RzWzUUiLuE
On 2023-05-02 at 20:39:35 +, "Kevin M. Wilson via Python-list" wrote: > [...] Where can I edit these out of my IDE? I doubt anyone will know unless you at least tell us which IDE you're using. -- https://mail.python.org/mailman/listinfo/python-list

Editing PEP-8, in particular "expected 2 blanks, found 1

2023-05-02 Thread Kevin M. Wilson via Python-list
Folks, help please! What the @#$! are these doing popping up. Code styles are personal, and not subject to debate.Where can I edit these out of my IDE? Kevin "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk th

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Cameron Simpson
On 29Jan2023 08:10, avi.e.gr...@gmail.com wrote: You are technically correct but perhaps off the mark. Yes, a python program only sees what is handed to it by some shell if invoked a certain way. The issue here is what you tell people using your program about what they need to type to get it

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Cameron Simpson
On 29Jan2023 07:12, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: On 2023-01-29 at 16:51:20 +1100, Cameron Simpson wrote: They're unrelated. As others have mentioned, "--" is _extremely_ common; almost _all_ UNIX command like programmes which handle -* style o

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Ethan Furman
This thread has run its course and seems to now be generating more heat than light. It is now closed (at least on the Python List side). Thank you everyone for your participation and understanding. -- ~Ethan~ Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Mark Bourne
Jach Feng wrote: Thank you for detail explanation of the role the shell is involved in this problem. I'm very appreciated! It seems that a CLI app may become very complex when dealing with different kind of shell, and may not be possible to solve its problem. But the good thing in my app is t

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Mark Bourne
Jach Feng wrote: Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 Also fail in REPL, e:

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Jach Feng
Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > Fail on command line, > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > usage: infix2postfix.py [-h] [infix] > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Peter J. Holzer
On 2023-01-27 21:03:39 -0800, Jach Feng wrote: > I have to admit that I don't know the background upon which the > argparse was built. The good side is that I don't carry its historical > knowledge ( or burden?), that's why I can use it in a new way I don't see what's new about that. > which may

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Peter J. Holzer
On 2023-01-29 07:59:21 -0500, avi.e.gr...@gmail.com wrote: > Although today you could say POSIX is the reason for many things including > the use of "--" I hesitate to mention I and many others used that convention > long before as a standard part of many UNIX utilities. I somewhat doubt that you

RE: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread avi.e.gross
"--" ... -Original Message- From: Python-list On Behalf Of Cameron Simpson Sent: Sunday, January 29, 2023 12:51 AM To: python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? On 28Jan2023 18:55, Jach Feng wrote: >Mark Bour

RE: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread avi.e.gross
tandardize, ... -Original Message- From: Python-list On Behalf Of 2qdxy4rzwzuui...@potatochowder.com Sent: Sunday, January 29, 2023 7:12 AM To: python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? On 2023-01-29 at 16:51:20 +1100, Ca

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread 2QdxY4RzWzUUiLuE
On 2023-01-29 at 16:51:20 +1100, Cameron Simpson wrote: > They're unrelated. As others have mentioned, "--" is _extremely_ common; > almost _all_ UNIX command like programmes which handle -* style options > honour the "--" convention. _argparse_ itself honours that convention, as > does getopt et

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Cameron Simpson
On 28Jan2023 18:55, Jach Feng wrote: Mark Bourne 在 2023年1月28日 星期六晚上10:00:01 [UTC+8] 的信中寫道: I notice you explain the need to enclose the equation in quotes if it contains spaces. That's not even a feature of your application, but of the shell used to call it. So why so much objecti

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Chris Angelico
On Sun, 29 Jan 2023 at 14:29, Jach Feng wrote: > Thank you for detail explanation of the role the shell is involved in this > problem. I'm very appreciated! > > It seems that a CLI app may become very complex when dealing with different > kind of shell, and may not be possible to solve its probl

RE: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread avi.e.gross
to do what you want. -Original Message- From: Python-list On Behalf Of Jach Feng Sent: Saturday, January 28, 2023 12:04 AM To: python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8]

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Jach Feng
Mark Bourne 在 2023年1月28日 星期六晚上10:00:01 [UTC+8] 的信中寫道: > Jach Feng wrote: > > Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > >> Fail on command line, > >> > >> e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > >> u

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Jach Feng
Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > Fail on command line, > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > usage: infix2postfix.py [-h] [infix] > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Mark Bourne
Jach Feng wrote: Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 Also fail in REPL, e:

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-27 Thread Michael Torrie
On 1/25/23 19:50, Jach Feng wrote: > To me, argparse has been just a tool which I can use in a CLI app. argparse is just a tool for dealing with command-line *flags*, which are common in command-line tools. argparse interprets the command line as a bunch of flags because that's w

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-26 Thread Mats Wichmann
On 1/24/23 23:28, Jach Feng wrote: Chris Angelico 在 2023年1月25日 星期三下午1:16:25 [UTC+8] 的信中寫道: On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: I was happy working with argparse during implement my script. To save the typing, I used a default equation for testing. sample = "-4^2+5.3*abs(-2

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread Chris Angelico
On Thu, 26 Jan 2023 at 14:13, Jach Feng wrote: > Now I understand some oppose this idea and saying that you shouldn't use a > kitchen knife to cut a cake:-) You shouldn't use a chainsaw to cut a cake, and then ask us why cake-cutting is so noisy. ChrisA -- https://mail.python.org/mailman/listi

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread Jach Feng
Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > Fail on command line, > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > usage: infix2postfix.py [-h] [infix] > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread David
On Thu, 26 Jan 2023 at 04:24, Jach Feng wrote: > Chris Angelico 在 2023年1月25日 星期三下午1:16:25 [UTC+8] 的信中寫道: > > On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: > > You're still not really using argparse as an argument parser. Why not > > just do your own -h checking? Stop

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread Weatherby,Gerard
ult, controlling the number of arguments and the like. From: Python-list on behalf of Jach Feng Date: Wednesday, January 25, 2023 at 12:25 PM To: python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? *** Attention: This is an external

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread Chris Angelico
On Thu, 26 Jan 2023 at 04:25, Jach Feng wrote: > > Chris Angelico 在 2023年1月25日 星期三下午1:16:25 [UTC+8] 的信中寫道: > > On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: > > > I was happy working with argparse during implement my script. To save the > > > typing, I used

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread Jach Feng
Chris Angelico 在 2023年1月25日 星期三下午1:16:25 [UTC+8] 的信中寫道: > On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: > > I was happy working with argparse during implement my script. To save the > > typing, I used a default equation for testing. > > > > sample = "-4^2+5

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Cameron Simpson
you have many options to handle? sample = "-4^2+5.3*abs(-2-1)/2, abs(Abc)*(B+C)/D, (-3) * sqrt(1-(x1/7)*(y1/7)) * sqrt(abs((x0-4.5)/(y0-4)))" parser = argparse.ArgumentParser(description='Convert infix notation to postfix') parser.add_argument('infix', n

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Chris Angelico
On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: > I was happy working with argparse during implement my script. To save the > typing, I used a default equation for testing. > > sample = "-4^2+5.3*abs(-2-1)/2, abs(Abc)*(B+C)/D, (-3) * > sqrt(1-(x1/7)*(y1/7)) * sqrt(abs((x0-4.5

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Jach Feng
Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > Fail on command line, > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > usage: infix2postfix.py [-h] [infix] > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Jach Feng
avi.e...@gmail.com 在 2023年1月25日 星期三清晨6:39:13 [UTC+8] 的信中寫道: > If I understood the issue, the problem is the unary minus at the start of the > expression. > > So if you know the expression is in that argument, would it make sense to pad > it in one of many ways that are oth

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Jach Feng
Michael Torrie 在 2023年1月25日 星期三凌晨3:05:44 [UTC+8] 的信中寫道: > On 1/23/23 18:58, Jach Feng wrote: > > More pathonic, but don't work. The '--' must be at index 1:-) > I'm very confused. Why are you even using argparse, since if you put -- > at index 1 then argpars

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Dennis Lee Bieber
On Tue, 24 Jan 2023 15:13:33 + (UTC), Mike Baskin declaimed the following: >Can you stop please > Stop what? You appear to be subscribed to the Python mailing list -- as such you WILL receive all traffic that appears on that list. There is nothing we can do. It is not a pers

RE: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread avi.e.gross
If I understood the issue, the problem is the unary minus at the start of the expression. So if you know the expression is in that argument, would it make sense to pad it in one of many ways that are otherwise harmless? Could you put parens on both sides of "-4^2+5.3*abs(-2-1)/2":

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Mike Baskin via Python-list
Can you stop please Sent from Yahoo Mail for iPhone On Tuesday, January 24, 2023, 10:12 AM, Thomas Passin wrote: On 1/23/2023 9:12 PM, Chris Angelico wrote: > On Tue, 24 Jan 2023 at 13:09, Jach Feng wrote: >> >> Chris Angelico 在 2023年1月24日 星期二清晨5:00:27 [UTC+8] 的信中寫道: >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Mike Baskin via Python-list
Stop please Sent from Yahoo Mail for iPhone On Tuesday, January 24, 2023, 1:05 AM, Cameron Simpson wrote: On 23Jan2023 17:58, Jach Feng wrote: >>>> parser.parse_args(['--', 'infix2postfix.py', '-4.3+5']) >usage: [-h] infix >: error: unrecog

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Jach Feng
cameron...@gmail.com 在 2023年1月24日 星期二下午2:05:33 [UTC+8] 的信中寫道: > On 23Jan2023 17:58, Jach Feng wrote: > >>>> parser.parse_args(['--', 'infix2postfix.py', '-4.3+5']) > >usage: [-h] infix > >: error: unrecognized arguments: -4.3+5 >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Michael Torrie
On 1/23/23 18:58, Jach Feng wrote: > More pathonic, but don't work. The '--' must be at index 1:-) I'm very confused. Why are you even using argparse, since if you put -- at index 1 then argparse wont't do any argument parsing at all. If all you want is the expressi

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? WRONG TOOL

2023-01-24 Thread Weatherby,Gerard
thread is a massive "how can I use X to do Y?" problem. From: Python-list on behalf of Thomas Passin Date: Tuesday, January 24, 2023 at 10:23 AM To: Mike Baskin , python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? *** A

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Thomas Passin
On 1/24/2023 10:13 AM, Mike Baskin wrote: Can you stop please It's way past time, isn't it! Sent from Yahoo Mail for iPhone <https://overview.mail.yahoo.com/?.src=iOS> On Tuesday, January 24, 2023, 10:12 AM, Thomas Passin wrote: On 1/23/2023 9:12 PM, Chris Angelico

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Thomas Passin
On 1/23/2023 9:12 PM, Chris Angelico wrote: On Tue, 24 Jan 2023 at 13:09, Jach Feng wrote: Chris Angelico 在 2023年1月24日 星期二清晨5:00:27 [UTC+8] 的信中寫道: On Tue, 24 Jan 2023 at 07:47, Cameron Simpson wrote: But for Jach Feng: the "--" is really expected as something the user does

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Cameron Simpson
On 23Jan2023 17:58, Jach Feng wrote: parser.parse_args(['--', 'infix2postfix.py', '-4.3+5']) usage: [-h] infix : error: unrecognized arguments: -4.3+5 This error doesn't look like "-4.3+5 looks like an option" but instead "we don't expect any arguments after "infix". Not personally a fan o

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Jach Feng
Greg Ewing 在 2023年1月24日 星期二清晨7:33:43 [UTC+8] 的信中寫道: > >> On 2023-01-22 at 18:19:13 -0800, > >> Jach Feng wrote: > >>> 1) Modify the sys.argv by inserting an item '--' before parsing it, ie. > >>> sys.argv.insert(1, '--') > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Chris Angelico
On Tue, 24 Jan 2023 at 13:09, Jach Feng wrote: > > Chris Angelico 在 2023年1月24日 星期二清晨5:00:27 [UTC+8] 的信中寫道: > > On Tue, 24 Jan 2023 at 07:47, Cameron Simpson wrote: > > > > > > But for Jach Feng: the "--" is really expected as something the user &g

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Jach Feng
Chris Angelico 在 2023年1月24日 星期二清晨5:00:27 [UTC+8] 的信中寫道: > On Tue, 24 Jan 2023 at 07:47, Cameron Simpson wrote: > > > > But for Jach Feng: the "--" is really expected as something the user > > does when they invoke your programme, _explicitly_ saying that what

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Jach Feng
2qdxy4rz...@potatochowder.com 在 2023年1月24日 星期二凌晨2:47:12 [UTC+8] 的信中寫道: > On 2023-01-22 at 18:19:13 -0800, > Jach Feng wrote: > > > 1) Modify the sys.argv by inserting an item '--' before parsing it, ie. > > sys.argv.insert(1, '--') > > ar

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Greg Ewing
On 2023-01-22 at 18:19:13 -0800, Jach Feng wrote: 1) Modify the sys.argv by inserting an item '--' before parsing it, ie. sys.argv.insert(1, '--') args = parser.parse_args() If you do that, you'll never be able to have any actual options, so using argparse seems lik

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Chris Angelico
> your_script -x -y -- "-4^2+5.3*abs(-2-1)/2" > > where there are -x and -y options, then end of options, then an > argument, which would look like an option if there wasn't the "--" > argument. And if you DON'T expect the user to enter the &qu

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Cameron Simpson
On 23Jan2023 13:46, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: On 2023-01-22 at 18:19:13 -0800, Jach Feng wrote: 1) Modify the sys.argv by inserting an item '--' before parsing it, ie. sys.argv.insert(1, '--') args = parser.pars

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread 2QdxY4RzWzUUiLuE
On 2023-01-22 at 18:19:13 -0800, Jach Feng wrote: > 1) Modify the sys.argv by inserting an item '--' before parsing it, ie. > sys.argv.insert(1, '--') > args = parser.parse_args() Please don't do that. :-) In my mind, sys.argv belongs to Python, not the a

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Jach Feng
Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > Fail on command line, > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > usage: infix2postfix.py [-h] [infix] > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Grant Edwards
On 2023-01-22, Weatherby,Gerard wrote: > Argparse is for parsing command line arguments and options. > > If you just want to evaluate an Python expression, use eval( ) Only use eval() if the expression is always under your control (and you don't make mistakes when typing). Don't use eval() on st

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Michael Torrie
On 1/22/23 11:44, Stefan Ram wrote: > Jach Feng writes: >> e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > > Well, it's a nice exercise! But I only made it work for the > specific example given. I have not tested whether it always > work

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Cameron Simpson
On 21Jan2023 19:11, Jach Feng wrote: Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 The usual convention for having "nonoption&qu

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Weatherby,Gerard
Argparse is for parsing command line arguments and options. If you just want to evaluate an Python expression, use eval( ) Your string isn’t valid Python due to order of operations, but -(4^2)+5.3*abs(-2-1)/2 is. From: Python-list on behalf of Jach Feng Date: Sunday, January 22, 2023 at 11

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Thomas Passin
On 1/22/2023 10:45 AM, Peter J. Holzer wrote: Notice that this file is in its first release, version 0.0.1 - the metadata that says it's 'Development Status :: 5 - Production/Stable' seems to be bogus. So it may very well be buggy. It is at least too incomplete to be useful.

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Mark Bourne
Jach Feng wrote: Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 Also fail in REPL, e:\Works\Python>py Python 3.8.8 (tags/v3.8.8:024d805,

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Jach Feng
Thomas Passin 在 2023年1月22日 星期日下午1:30:39 [UTC+8] 的信中寫道: > On 1/21/2023 10:11 PM, Jach Feng wrote: > > Fail on command line, > > > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > > usage: infix2postfix.py [-h] [infix] > > infix2postf

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Peter J. Holzer
On 2023-01-22 00:30:07 -0500, Thomas Passin wrote: > On 1/21/2023 10:11 PM, Jach Feng wrote: > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > > usage: infix2postfix.py [-h] [infix] > > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-21 Thread Thomas Passin
On 1/21/2023 10:11 PM, Jach Feng wrote: Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 Also fail in REPL, e:\Works\Python>py Python 3.

How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-21 Thread Jach Feng
Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 Also fail in REPL, e:\Works\Python>py Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:08

RE: Python-list Digest, Vol 232, Issue 1

2023-01-02 Thread avi.e.gross
before or after the "value" is used. Code like: X += 1 Or X = X + 1 Followed by Y = X Can be longer but a tad clearer, as is code like: Y = X X -= 1 I have seen code in languages that support this that can take some head scratching to figure out when combinations using parentheses an

Re: Python-list Digest, Vol 232, Issue 1

2023-01-01 Thread Christman, Roger Graydon
n-list on behalf of python-list-requ...@python.org Sent: Sunday, January 1, 2023 12:00 PM To: python-list@python.org Subject: Python-list Digest, Vol 232, Issue 1 Send Python-list mailing list submissions to python-list@python.org To subscribe or unsubscribe via the World Wide Web, visit

Re: [python-committers] [RELEASE] Python 3.11 release candidate 1 (3.11.0rc1) is available

2022-08-08 Thread Terry Reedy
On 8/8/2022 12:59 PM, Pablo Galindo Salgado wrote: Python 3.11.0 is almost ready. This release, 3.11.0rc1, is the penultimate release preview. You can get it here: ## This is the first release candidate of Python 3.11 https://www.python.org/downloads/release/python-3110rc1/

[RELEASE] Python 3.11 release candidate 1 (3.11.0rc1) is available

2022-08-08 Thread Pablo Galindo Salgado
Python 3.11.0 is almost ready. This release, 3.11.0rc1, is the penultimate release preview. You can get it here: ## This is the first release candidate of Python 3.11 https://www.python.org/downloads/release/python-3110rc1/ This release, **3.11.0rc1**, is the penultimate release preview. Enteri

Re: How to decode ISO8859-1 in Python 3?

2021-11-28 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >I have some text files which are ISO8859-1 encoded and I want to output > >them to screen using Python. > > Well, the first attempt would be: > > import pathlib > name = r"C:\example.txt" > encoding

How to decode ISO8859-1 in Python 3?

2021-11-28 Thread Chris Green
This sounds as if it should be trivial but searching only seems to produce ways ofd doing it in Python 2. I have some text files which are ISO8859-1 encoded and I want to output them to screen using Python. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Struggling to understand timedelta rpesentation when applying an offset for an hour earlier - why is days = -1?

2021-08-31 Thread Dennis Lee Bieber
On Tue, 31 Aug 2021 03:59:52 -0700 (PDT), dcs3spp via Python-list declaimed the following: >I cannot understand why the resultant datetime.timedelta is days=-1, >seconds=82800 (23 hours) . > Read the documentation... https://docs.python.org/3/library/datetime.html#timedelt

Re: Struggling to understand timedelta rpesentation when applying an offset for an hour earlier - why is days = -1?

2021-08-31 Thread Chris Angelico
On Wed, Sep 1, 2021 at 1:55 AM dcs3spp via Python-list wrote: > > Hi, > > I wonder if anyone can help > > I am struggling to understand the representation of timedelta when used in > conjunction with astimezone. > > Given the code below, in a python interactive

Struggling to understand timedelta rpesentation when applying an offset for an hour earlier - why is days = -1?

2021-08-31 Thread dcs3spp via Python-list
```bash >>> dt = datetime(2021, 8, 22, 23, 59, 31, tzinfo=timezone.utc) >>> hour_before=dt.astimezone(timezone(-timedelta(seconds=3600))) >>> hour_before datetime.datetime(2021, 8, 22, 22, 59, 31, tzinfo=datetime.timezone(datetime.timedelta(days=-1, sec

Re: XanaNews Statistic for comp.lang.python. 4/1/2021 5:52:47 AM

2021-04-01 Thread Abdur-Rahmaan Janhangeer
So, is that mail spam or ...? -- https://mail.python.org/mailman/listinfo/python-list

Re: XanaNews Statistic for comp.lang.python. 4/1/2021 5:52:47 AM

2021-04-01 Thread Chris Angelico
On Fri, Apr 2, 2021 at 7:55 AM dn via Python-list wrote: > > On 02/04/2021 01.19, Chris Angelico wrote: > > On Thu, Apr 1, 2021 at 10:56 PM The Doctor via Python-list > > wrote: > >> Top Posters > >> > >> Ranking Articles Nam

Re: XanaNews Statistic for comp.lang.python. 4/1/2021 5:52:47 AM

2021-04-01 Thread dn via Python-list
On 02/04/2021 01.19, Chris Angelico wrote: > On Thu, Apr 1, 2021 at 10:56 PM The Doctor via Python-list > wrote: >> Top Posters >> >> Ranking Articles NameMost Used Newsreader >> --- -- ---

Re: XanaNews Statistic for comp.lang.python. 4/1/2021 5:52:47 AM

2021-04-01 Thread Chris Angelico
On Thu, Apr 1, 2021 at 10:56 PM The Doctor via Python-list wrote: > Top Posters > > Ranking Articles NameMost Used Newsreader > --- -- ---- > 1 167 TestBank store G2 >

XanaNews Statistic for comp.lang.python. 4/1/2021 5:52:47 AM

2021-04-01 Thread The Doctor via Python-list
XanaNews Statistic for comp.lang.python. 4/1/2021 5:52:47 AM >From article 587730 (3/1/2021 4:09:02 AM) to article 588588 (3/31/2021 11:40:40 PM) Number of threads ... 385 Number of articles .. 895 Average articles per thread . 2.32 Number

Re: Python 3.9. 1 not working

2021-02-10 Thread Roland Mueller via Python-list
Hello, Please note that this is not a kind of support service rather than a community where people help each other on voluntary base. In order to get help from here, you should provide enough information about your issue with Python 3.9 that others can figure out what happened. BR, Roland ke 10

Python 3.9. 1 not working

2021-02-09 Thread Martin Lopez
Where do I inquire about installation support? -- https://mail.python.org/mailman/listinfo/python-list

Re: Why x+=1 doesn't return x value instead of an object

2020-10-31 Thread dn via Python-list
On 31/10/2020 19:41, Chris Angelico wrote: On Sat, Oct 31, 2020 at 4:44 PM dn via Python-list wrote: Free advice: whatever you do, don't call @Chris a walrus! Yeah... I do have quite a moustache, but it doesn't merit a high title like that! :) It's the tusks I'd be worried about! Is Dracula

Re: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

2020-10-31 Thread Mats Wichmann
On 10/30/20 1:38 PM, Gian_Xatzak. wrote: >When I tried to download  matplotlib, it show me that message in the end: > >  > >ERROR: Command errored out with exit status 1: python setup.py egg_info >Check the logs for full command output. > >  &g

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread Chris Angelico
On Sat, Oct 31, 2020 at 4:44 PM dn via Python-list wrote: > Free advice: whatever you do, don't call @Chris a walrus! Yeah... I do have quite a moustache, but it doesn't merit a high title like that! :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread dn via Python-list
On 31/10/2020 16:20, Chris Angelico wrote: On Sat, Oct 31, 2020 at 1:51 PM Jon Ribbens via Python-list wrote: On 2020-10-31, Stefan Ram wrote: Siddhharth Choudhary writes: I want to know why x+=1 does not return the value of the variable. Which value? The old or the new one

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread Chris Angelico
On Sat, Oct 31, 2020 at 2:41 PM Jon Ribbens via Python-list wrote: > > On 2020-10-31, Chris Angelico wrote: > > On Sat, Oct 31, 2020 at 1:51 PM Jon Ribbens via Python-list > > wrote: > >> > >> On 2020-10-31, Stefan Ram wrote: > >> > Siddhharth C

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread Jon Ribbens via Python-list
On 2020-10-31, Chris Angelico wrote: > On Sat, Oct 31, 2020 at 1:51 PM Jon Ribbens via Python-list > wrote: >> >> On 2020-10-31, Stefan Ram wrote: >> > Siddhharth Choudhary writes: >> >>I want to know why x+=1 does not return the value of the variable.

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread Chris Angelico
On Sat, Oct 31, 2020 at 1:51 PM Jon Ribbens via Python-list wrote: > > On 2020-10-31, Stefan Ram wrote: > > Siddhharth Choudhary writes: > >>I want to know why x+=1 does not return the value of the variable. > > > > Which value? The old or the new one? &

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread Jon Ribbens via Python-list
On 2020-10-31, Stefan Ram wrote: > Siddhharth Choudhary writes: >>I want to know why x+=1 does not return the value of the variable. > > Which value? The old or the new one? > > Expressions never return values. Except when they're assignment expression

Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread Siddhharth Choudhary
I want to know why x+=1 does not return the value of the variable. It would be great if It has returned the value of the variable instead of an object. It will increase the beauty of python. For instance, x = 5 x+=1 print(x) = 6 If x+=1 had returned

Re: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

2020-10-30 Thread Chris Angelico
On Sat, Oct 31, 2020 at 6:39 AM Gian_Xatzak. wrote: > >When I tried to download matplotlib, it show me that message in the end: > > > >ERROR: Command errored out with exit status 1: python setup.py egg_info >Check the logs for full command output. > Did

  1   2   3   4   5   6   7   8   9   10   >