[Python-Dev] Re: [RELEASE] The cursed fourth Python 3.11 beta (3.11.0b4) is available

2022-07-14 Thread Stephen J. Turnbull
Alan G. Isaac writes:

 > 4. It implements ISO 8601 (which exists for a reason):
 > https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates

Yes!!!  "Standardization is my Valentine!" :-D

-- 
RIP WotR Bombshell
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/O7EKVHRG3GGAHYGQEPCUMPPYU5S67FGO/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-14 Thread Terry Reedy

On 7/14/2022 6:16 PM, Guido van Rossum wrote:

In addition, we already use square brackets for *using* generics (e.g. 
list[int]), and most surveyed languages use the same type of brackets in 
declarations and uses.


I do not yet use annotations, but knowing about 'list[int]', etc, I 
could immediately read and understand the new examples.



On Thu, Jul 14, 2022 at 1:10 PM > wrote:


Hi, I like this PEP but I couldn't find the motivation for using
angle brackets over square braces (brackets?).


I presume you meant the reverse, for proposing [] over <>.  I agree that 
giving the motivation above (and the one deleted) would be good idea.


--
Terry Jan Reedy

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/JO6KUMZORJ5GCF5WWMNAMNYWBUUFFMGY/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: [RELEASE] The cursed fourth Python 3.11 beta (3.11.0b4) is available

2022-07-14 Thread Alan G. Isaac

4. It implements ISO 8601 (which exists for a reason):
https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates


On 7/14/2022 6:25 PM, MRAB wrote:

I much prefer -MM-DD (or .MM.DD) because:

1. It's consistent with HH:MM:SS and other instances where there are multiple 
units (they go from largest to smallest).

2. It's easier to sort them.

3. It removes the confusion over whether it's DD/MM/ or MM/DD/.

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/DFEK4NWWGIVZEHAFS3NF2QPFAAYIAETJ/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: [RELEASE] The cursed fourth Python 3.11 beta (3.11.0b4) is available

2022-07-14 Thread MRAB

On 13/07/2022 12:12, h.vetin...@gmx.com wrote:

Also the GH bot is using DD/MM/ date format :-( whyy?


Because github is international, and everyone but the US seems to agree that
```
/\
   /  \
  /\
 / day  \
/\
   /  \
  /month   \
 /__\
/\
   /   year   \
  /\
```
is preferable to
```
__
   /  \
  /month   \
 /__\
/\
   /  \
  /\
 / day  \
 ___/\___
/\
   /   year   \
  /\
```


I much prefer -MM-DD (or .MM.DD) because:

1. It's consistent with HH:MM:SS and other instances where there are 
multiple units (they go from largest to smallest).


2. It's easier to sort them.

3. It removes the confusion over whether it's DD/MM/ or MM/DD/.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/QIEETJHYC5Z7AXXSE6NBKY3CJG7VN6SO/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-14 Thread Guido van Rossum
Yeah, we all would have liked angle brackets, but there would be problems
with breaking lines between those. E.g.

def foo<
T: str,
S: int
> (arg1: T, arg2: S) -> tuple[T, S]:
...

cannot be parsed because the lexer doesn't treat angle brackets as matching
pairs.

In addition, we already use square brackets for *using* generics (e.g.
list[int]), and most surveyed languages use the same type of brackets in
declarations and uses.

On Thu, Jul 14, 2022 at 1:10 PM  wrote:

> Hi, I like this PEP but I couldn't find the motivation for using angle
> brackets over square braces (brackets?). The survey in Appendix A is great
> but lacks any conclusions. From that survey alone I would assume that angle
> brackets would have been chosen over square braces, given that they are the
> most common option and appear in (afaik) the more popular languages in that
> list. I think the PEP should add a section about the choice of syntax in
> the rejected section, which can be expanded upon in Appendix A.
>
> If you can't tell I'm in favor of angle brackets, I think the examples
> given in the PEP look a bit messy with so many parentheses and square
> braces in close proximity. Using angle brackets would make the distinction
> between typevars and function parameters clearer.
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/2LEHJKQGRHCHGQUFXUU3DTYKKDISNPFN/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/CBCJCXDAQY5YXGBHRMLUGUNQAJMG3GAE/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Exceptions and tracebacks and frames, oh my!

2022-07-14 Thread Guido van Rossum
This may be something you've already figured out, or not useful for your
use case, but the key insight here tends to be that traceback objects form
a singly-linked list from the frame where the exception was caught up to
the frame where it was raised, whereas the frames are linked in the
opposite direction, from the most deeply nested frame down to the main/root
frame (or the start/bootstrap frame for threads).

Tracebacks link to the frame. The lineno in the traceback is where the
exception was raised (or bubbled out) whereas the lineno in the frame is
where the frame is currently executing (probably in the exception handling
code).

On Thu, Jul 14, 2022 at 1:05 PM Yonatan Zunger  wrote:

> Hi everyone,
>
> Apologies for pinging the dev list; I'm shaving a very hairy yak, and the
> python-help crew, the docs, and the source are all unable to help.
>
> Context: I'm working on a library function to dump stack traces for all
> threads, sorta like _Py_DumpTracebackThreads but in Python and meant to be
> invoked from a high layer, and thus be pretty and readable and so on rather
> than signal-safe and robust. The hard part is combining data from thread
> stack frames and exceptions, since people generally want to know about
> these.
>
> What I'm having trouble understanding is the relationship between an
> exception's TB and the thread's frame. Two important differences I've
> noticed are that (a) the output of traceback.print_tb(sys.exc_info()[2])
> and traceback.print_stack(sys.exc_info()[2].tb_frame) are markedly
> different -- the former gives data about where the exception was raised,
> while the latter about where the thread currently is, usually in an
> exception handler and (b) if I'm in a unittest and dump the stack for a
> thread starting from its current frame (using traceback.format_stack and
> sys._current_frames), it gives a very deep stack that includes all the
> unittest harness code etc., but if I dump the stack for an exception
> starting from its TB object, it instead is very short and focused on where
> the exception happened.
>
> All of which tells me that I don't understand the relationship between the
> exception's traceback object and the frames it points to at all.
>
> Is there somewhere that explains this particular bit of magic, or someone
> who's well-versed in it? I have to admit that after a few hours of
> spelunking the code, I can't even figure out how the exception traceback is
> being set in the first place. :)
>
> Again, apologies for bugging the dev list with what (I hope) is a simple
> question -- if there's a FM I should be reading, please let me know!
>
> Yonatan
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/IRPWIRAZ3K5Y2F466ZISGSF5JBF657CB/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/AM6ZT246YD4RCOSJIXJ5KTCVAPOM3DYC/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-14 Thread o . jacob . nilsson
Hi, I like this PEP but I couldn't find the motivation for using angle brackets 
over square braces (brackets?). The survey in Appendix A is great but lacks any 
conclusions. From that survey alone I would assume that angle brackets would 
have been chosen over square braces, given that they are the most common option 
and appear in (afaik) the more popular languages in that list. I think the PEP 
should add a section about the choice of syntax in the rejected section, which 
can be expanded upon in Appendix A.

If you can't tell I'm in favor of angle brackets, I think the examples given in 
the PEP look a bit messy with so many parentheses and square braces in close 
proximity. Using angle brackets would make the distinction between typevars and 
function parameters clearer.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/2LEHJKQGRHCHGQUFXUU3DTYKKDISNPFN/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Exceptions and tracebacks and frames, oh my!

2022-07-14 Thread Yonatan Zunger
Hi everyone,

Apologies for pinging the dev list; I'm shaving a very hairy yak, and the
python-help crew, the docs, and the source are all unable to help.

Context: I'm working on a library function to dump stack traces for all
threads, sorta like _Py_DumpTracebackThreads but in Python and meant to be
invoked from a high layer, and thus be pretty and readable and so on rather
than signal-safe and robust. The hard part is combining data from thread
stack frames and exceptions, since people generally want to know about
these.

What I'm having trouble understanding is the relationship between an
exception's TB and the thread's frame. Two important differences I've
noticed are that (a) the output of traceback.print_tb(sys.exc_info()[2])
and traceback.print_stack(sys.exc_info()[2].tb_frame) are markedly
different -- the former gives data about where the exception was raised,
while the latter about where the thread currently is, usually in an
exception handler and (b) if I'm in a unittest and dump the stack for a
thread starting from its current frame (using traceback.format_stack and
sys._current_frames), it gives a very deep stack that includes all the
unittest harness code etc., but if I dump the stack for an exception
starting from its TB object, it instead is very short and focused on where
the exception happened.

All of which tells me that I don't understand the relationship between the
exception's traceback object and the frames it points to at all.

Is there somewhere that explains this particular bit of magic, or someone
who's well-versed in it? I have to admit that after a few hours of
spelunking the code, I can't even figure out how the exception traceback is
being set in the first place. :)

Again, apologies for bugging the dev list with what (I hope) is a simple
question -- if there's a FM I should be reading, please let me know!

Yonatan
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/IRPWIRAZ3K5Y2F466ZISGSF5JBF657CB/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: [RELEASE] The cursed fourth Python 3.11 beta (3.11.0b4) is available

2022-07-14 Thread h . vetinari
> Also the GH bot is using DD/MM/ date format :-( whyy?

Because github is international, and everyone but the US seems to agree that
```
   /\
  /  \
 /\
/ day  \
   /\
  /  \
 /month   \
/__\
   /\
  /   year   \
 /\
```
is preferable to
```
   __
  /  \
 /month   \
/__\
   /\
  /  \
 /\
/ day  \
___/\___
   /\
  /   year   \
 /\
```
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/EQO2SCU76WC6JQAZOFVUZ2RHW4LU7GXI/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Presenting PEP 692: Using TypedDict for more precise **kwargs typing

2022-07-14 Thread Franek Magiera
Hello,

PEP 692 is posted. It proposes to use TypedDicts to type **kwargs that consist 
of different types. This feature has gained a lot of interest from the 
community (https://github.com/python/mypy/issues/4441). The PEP also proposes a 
grammar change and a new dunder __unpack__.

Here is the link to the PEP itself - https://peps.python.org/pep-0692/
And the discussion on discuss.python.org - 
https://discuss.python.org/t/pep-692-using-typeddict-for-more-precise-kwargs-typing/17314

Please share your comments, thoughts and feedback!

Franek
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/PLCNW2XR4OOKAKHEZQM7R2AYVYUXPZGW/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: [RELEASE] The cursed fourth Python 3.11 beta (3.11.0b4) is available

2022-07-14 Thread Mike mcleod
You have:
Report bugs at [https://bugs.python.org%5D(https://bugs.python.org).
Why not change to https://github.com/python/cpython/issues
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/RLFTD5OMA4K535NPNYW6NLZ3QQ64U3SX/
Code of Conduct: http://python.org/psf/codeofconduct/