[issue33387] Simplify bytecodes for try-finally, try-except and with blocks.

2021-01-25 Thread Irit Katriel
Change by Irit Katriel : -- status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue33387] Simplify bytecodes for try-finally, try-except and with blocks.

2021-01-25 Thread Irit Katriel
Irit Katriel added the comment: There's another place that needs to be updated: https://docs.python.org/3/library/dis.html#opcode-SETUP_WITH need to replace WITH_CLEANUP_START by WITH_EXCEPT_START -- ___ Python tracker

[issue43026] Missing words renders meaning unclear in fcntl.html

2021-01-25 Thread Ezra
New submission from Ezra : At https://docs.python.org/3/library/fcntl.html the docs read: the fcntl module exposes the F_OFD_GETLK, F_OFD_SETLK and F_OFD_SETLKW constants, which working with open file description locks. The exact intended meaning is unclear, perhaps: the fcntl module exposes

[issue43025] Use normal 'i

2021-01-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: https://mathworld.wolfram.com/j.html D and SmartBASIC use a literal suffix "i" for imaginary numbers. I can't find any other languages which support literal syntax for complex numbers, but I haven't looked very far. https://www.researchgate.net/profile/Ken

[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-25 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think it really matters what other languages do. We're not designing this from scratch. We need to reflect that state we're in, which is many, many lines of working code using 'j'. I see the two options as: support 'i' and 'j', or break existing code

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-25 Thread Tadek Kijkowski
Tadek Kijkowski added the comment: >> Is it up to the special handler of the positional parameter to read and save >> the values of the optional parameters specified so far? Yes, in order to get anything more that just concatenated list of positional parameters, one has to provide specialize

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-25 Thread Tadek Kijkowski
Tadek Kijkowski added the comment: This is, I think, smallest functional example for matching optional parameters with positionals - fruits.py: import argparse DEFAULT_COLOR="plain" class AddFruitAction(argparse.Action): def __call__(self, parser, namespace, values, option_st

[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: I think it always helps to look at what other languages do. It doesn't mean that we must follow them, but it may help us decide that the choice made in Python 1 was a mistake and it is worth going through the pain of deprecation, or that it is still justifi

[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-25 Thread Eric V. Smith
Eric V. Smith added the comment: Good point on surveying other languages for a PEP. You're further along in your thinking than I am! -- ___ Python tracker ___ ___

[issue43026] Missing words renders meaning unclear in fcntl.html

2021-01-25 Thread Ezra
Change by Ezra : -- versions: +Python 3.10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue43015] Add str.replaceall?

2021-01-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: Versions 3.6-3.9 are all in feature-freeze, so the earliest this could be added is version 3.10. -- nosy: +steven.daprano versions: -Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker

[issue41962] Make threading._register_atexit public?

2021-01-25 Thread Ben Darnell
Ben Darnell added the comment: I have resolved my issue here by moving from ThreadPoolExecutor to a plain threading.Thread that I manage by hand (https://github.com/tornadoweb/tornado/commit/15832bc423c33c9280564770046dd6918f3a31b4). Therefore I no longer need this for myself and I leave it

[issue43027] Calling _PyBytes_Resize() on 1-byte bytes may raise error

2021-01-25 Thread Ma Lin
New submission from Ma Lin : PyBytes_FromStringAndSize() uses a global cache for 1-byte bytes: https://github.com/python/cpython/blob/v3.10.0a4/Objects/bytesobject.c#L147 if (size == 1 && str != NULL) { struct _Py_bytes_state *state = get_bytes_state(); op = state->characters

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-25 Thread Glenn Linderman
Glenn Linderman added the comment: OK, I think I see what you are doing here. Thanks for your responses. And probably it is the bare-bones minimum feature that allows user-implementation of "as complex as desired" combinations of optionals and context-sensitive positionals. In the docs frui

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-25 Thread Glenn Linderman
Glenn Linderman added the comment: for more helpful => far more helpful -- ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue43028] seeking past the end of a file unexpected behavior

2021-01-25 Thread Cotton Seed
New submission from Cotton Seed : Seeking past the end of a file with file objects does not match the same code implemented in terms of file descriptors. Is this the intended behavior? Smallest example I could find: f = open('new_file', 'ab') print(f.seek(1)) print(f.write(b'foo')) print(f.t

[issue43028] seeking past the end of a file unexpected behavior

2021-01-25 Thread Christian Heimes
Christian Heimes added the comment: The high level and low level variants behave the same if you pass in the same flags. You are using the append flag in "open()", but you don't pass the os.O_APPEND flag to "os.open()". >>> import os >>> fd = os.open('log', os.O_WRONLY | os.O_APPEND | os.O_C

[issue43028] seeking past the end of a file unexpected behavior

2021-01-25 Thread Cotton Seed
Cotton Seed added the comment: Christian, thanks for the quick response and the clarification. I understand my mistake now. Thanks! -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

<    1   2