[Python-ideas] Re: else without except

2023-08-01 Thread Ronald Oussoren via Python-ideas
> On 1 Aug 2023, at 19:59, Mitch wrote: > > Is this a relevant argument (either way) here? Adding features to the language always has a cost in that it slightly complicates the language and makes it harder to teach. Because of that the bar for adding features is high. Showing how a new

[Python-ideas] Re: [Feature Request] Add attribute font_path to the class tkinter.font.Font

2022-12-14 Thread Ronald Oussoren via Python-ideas
> On 13 Dec 2022, at 01:47, Jérémie Bergeron > wrote: > > Hi, > > I think it would be usefull if the class tkinter.font.Font > > would contain the path to the font. > > With it, we can use many software like

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-12 Thread Ronald Oussoren via Python-ideas
> On 12 Apr 2022, at 13:17, malmiteria wrote: > > Steven D'Aprano writes: > >> So in the general case, order matters. We have to linearize the >> superclasses, and call them in that linear order, and the best way to do >> that is with the MRO and super. > Why would we *have* to do that? >

[Python-ideas] Re: Custom literals, a la C++

2022-04-11 Thread Ronald Oussoren via Python-ideas
> On 10 Apr 2022, at 11:20, Chris Angelico wrote: > > On Sun, 10 Apr 2022 at 18:44, Ronald Oussoren via Python-ideas > mailto:python-ideas@python.org>> wrote: >> >> >> >> On 8 Apr 2022, at 16:33, Steven D'Aprano wrote: >> >> On Tue,

[Python-ideas] Re: Custom literals, a la C++

2022-04-10 Thread Ronald Oussoren via Python-ideas
> On 8 Apr 2022, at 16:33, Steven D'Aprano wrote: > > On Tue, Apr 05, 2022 at 02:17:00PM +1000, Chris Angelico wrote: > >> Do you ever have one module that's using statute miles and >> another that's using nautical miles, but *not both in the same >> module*? The only reason to have them

[Python-ideas] Re: Revisiting a frozenset display literal

2022-01-17 Thread Ronald Oussoren via Python-ideas
> On 16 Jan 2022, at 18:44, Christopher Barker wrote: > > Is there no way to optimize the byte code without adding to the language? > > Not that it’s a bad idea anyway, but I wonder if frozen sets are common > enough to warrant a change. > > Are there any performance advantages to a frozen

[Python-ideas] Re: NAN handling in statistics functions

2021-08-31 Thread Ronald Oussoren via Python-ideas
> On 30 Aug 2021, at 18:19, Christopher Barker wrote: > > On Mon, Aug 30, 2021 at 12:57 AM Ronald Oussoren <mailto:ronaldousso...@mac.com>> wrote: > > On 28 Aug 2021, at 07:14, Christopher Barker > <mailto:python...@gmail.com>> wrote: >> >&g

[Python-ideas] Re: NAN handling in statistics functions

2021-08-30 Thread Ronald Oussoren via Python-ideas
> On 28 Aug 2021, at 07:14, Christopher Barker wrote: > > > SciPy should probably also be a data-point, it uses: > > nan_policy : {'propagate', 'raise', 'omit'}, optional > > +1 > > Also +1 on a string flag, rather than an Enum. Why do you prefer strings for the options rather than an

[Python-ideas] Re: C API for converting Python integers to/from bytes sequences

2021-08-11 Thread Ronald Oussoren via Python-ideas
> On 8 Aug 2021, at 18:53, Serhiy Storchaka wrote: > > 08.08.21 07:08, Stephen J. Turnbull пише: >> Serhiy Storchaka writes: >> >>> Python integers have arbitrary precision. For serialization and >>> interpolation with other programs and libraries we need to >>> represent them [...]. [In the

[Python-ideas] Re: Add static variable storage in functions

2021-05-28 Thread Ronald Oussoren via Python-ideas
> On 27 May 2021, at 18:15, Steven D'Aprano wrote: > > On Thu, May 27, 2021 at 04:53:17PM +0200, Ronald Oussoren via Python-ideas > wrote: > >> Statics are still hidden global state > > How are they *global* state when they are specific to an individual > fun

[Python-ideas] Re: Add static variable storage in functions

2021-05-28 Thread Ronald Oussoren via Python-ideas
> On 27 May 2021, at 17:24, Steven D'Aprano wrote: > > On Thu, May 27, 2021 at 04:37:10PM +0200, Ronald Oussoren wrote: > >>> One common use for function defaults is to optimize function lookups to >>> local variables instead of global or builtins: &g

[Python-ideas] Re: Add static variable storage in functions

2021-05-27 Thread Ronald Oussoren via Python-ideas
> On 27 May 2021, at 11:42, Chris Angelico wrote: > > On Thu, May 27, 2021 at 7:20 PM Ronald Oussoren via Python-ideas > wrote: >> On 27 May 2021, at 09:56, Shreyan Avigyan wrote: >> >>> Static should behave much like Python's for loop variables. &g

[Python-ideas] Re: Add static variable storage in functions

2021-05-27 Thread Ronald Oussoren via Python-ideas
> On 27 May 2021, at 14:18, Steven D'Aprano wrote: > > On Thu, May 27, 2021 at 07:56:16AM -, Shreyan Avigyan wrote: > >> Lot of programming languages have something known as static variable >> storage in *functions* not *classes*. Static variable storage means a >> variable limited to a

[Python-ideas] Re: Add static variable storage in functions

2021-05-27 Thread Ronald Oussoren via Python-ideas
> On 27 May 2021, at 09:56, Shreyan Avigyan wrote: > > Lot of programming languages have something known as static variable storage > in *functions* not *classes*. Static variable storage means a variable > limited to a function yet the data it points to persists until the end of the >

[Python-ideas] Re: Improve the textual representation of IPv4-mapped IPv6 addresses

2021-03-25 Thread Ronald Oussoren via Python-ideas
> On 18 Mar 2021, at 11:07, Maxime Mouchet wrote: > > Hi, > > Python supports IPv4-mapped IPv6 addresses as defined by RFC 4038: > "the IPv6 address :::x.y.z.w represents the IPv4 address x.y.z.w.” > > The current behavior is as follows: > >from ipaddress import ip_address >

[Python-ideas] Re: Python with braces formal proposal?

2021-01-05 Thread Ronald Oussoren via Python-ideas
> On 5 Jan 2021, at 11:38, Paul Sokolovsky wrote: > > Hello, > > On Tue, 5 Jan 2021 21:03:06 +1100 > Chris Angelico mailto:ros...@gmail.com>> wrote: > >> On Tue, Jan 5, 2021 at 8:32 PM Paul Sokolovsky >> wrote: >>> And you seem to have 2nd level miss about this miss. I'm not the 1st >>>

[Python-ideas] Re: Python with braces formal proposal?

2021-01-05 Thread Ronald Oussoren via Python-ideas
> On 4 Jan 2021, at 12:29, Paul Sokolovsky wrote: > > Hello, > > On Mon, 4 Jan 2021 21:47:26 +1100 > Chris Angelico mailto:ros...@gmail.com>> wrote: > >> On Mon, Jan 4, 2021 at 9:41 PM Paul Sokolovsky >> wrote: >>> >>> Hello, >>> >>> There're tons of projects which introduce alternative

[Python-ideas] Re: tkinter Variable implementation

2020-12-13 Thread Ronald Oussoren via Python-ideas
Could you file an issue about this on bugs.python.org ? Ronald — Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ > On 13 Dec 2020, at 03:16, Ivo Shipkaliev wrote: > > Hiya :) > > I'm recently working with tkinter and I noticed that: > >

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-24 Thread Ronald Oussoren via Python-ideas
> On 24 Nov 2020, at 11:58, Antoine Pitrou wrote: > > On Tue, 24 Nov 2020 10:23:10 + > Paul Moore wrote: >> On Tue, 24 Nov 2020 at 10:18, Antoine Pitrou wrote: >>> >>> On Mon, 23 Nov 2020 08:09:07 + >>> Paul Moore wrote: But it's not as limiting as you suggest - it

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-22 Thread Ronald Oussoren via Python-ideas
> On 22 Nov 2020, at 01:01, Greg Ewing wrote: > > On 21/11/20 3:59 pm, Christopher Barker wrote: >> On Fri, Nov 20, 2020 at 4:18 PM Greg Ewing > With venvs, it seems like it should be possible to have a very >>simple tool that just packages up everything in your venv. > > >> conda is

[Python-ideas] Re: A pypi-based app store solution for platform specific installation

2020-11-21 Thread Ronald Oussoren via Python-ideas
> On 20 Nov 2020, at 16:42, Ricky Teachey wrote: > > I was reading the pyinstaller thread and had this idea but didn't want to > hijack. > > Maybe a wild idea, and very possible totally impractical or hopelessly > complex, but: could the existing pypi infrastructure be leveraged into a set

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-20 Thread Ronald Oussoren via Python-ideas
> On 20 Nov 2020, at 15:03, Paul Moore wrote: > > On Fri, 20 Nov 2020 at 13:47, Greg Ewing wrote: >> >> I've seen this sort of thing in other app bundlers too, e.g. >> last time I looked py2app and py2exe had a bunch of special casing >> for various libraries. >> >> This is quite a big

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-20 Thread Ronald Oussoren via Python-ideas
> On 20 Nov 2020, at 14:45, Greg Ewing wrote: > > On 20/11/20 9:17 pm, Andrew Svetlov wrote: >> Digging into the problem more, I've figured out that PyInstaller has hooks >> >> for a bunch of popular libraries to

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-20 Thread Ronald Oussoren via Python-ideas
> On 20 Nov 2020, at 08:13, Abdur-Rahmaan Janhangeer > wrote: > > > - Some people, including me, don't think at this point this is a good idea > > to integrate PyInstaller in the Python code base. > > The maintainer of Py2App said > > > FWIW I don’t think that bundling any of these tools

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-20 Thread Ronald Oussoren via Python-ideas
> On 19 Nov 2020, at 20:17, Steven D'Aprano wrote: > > On Fri, Nov 20, 2020 at 02:05:02AM +1300, Greg Ewing wrote: >> On 20/11/20 12:24 am, Chris Angelico wrote: >>> >>> Have you considered the value of using zipapp >> >>> You get all the advantages of a single runnable file, and >>> all

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-19 Thread Ronald Oussoren via Python-ideas
> On 19 Nov 2020, at 08:48, Paul Moore wrote: > > On Thu, 19 Nov 2020 at 07:42, Stéfane Fermigier wrote: > >> But cooperation between the PyInstaller team and the Python Packaging >> Authority, if this doesn't happen already, could probably help. > > It doesn't, but that is simply because

[Python-ideas] Re: Exceptions as function calls to kill boilerplate

2020-10-13 Thread Ronald Oussoren via Python-ideas
> On 13 Oct 2020, at 16:08, jmwar...@gmail.com wrote: > > Steven, > Thanks for the responses. In response to your responses: > Steven D'Aprano wrote: >> Hi jmward01, >> I'm not really sure what you mean by "boilerplate heavy objects". >> Boilerplate generally applies to the amount of source

[Python-ideas] Re: Type Implications in Python 4 (or 3.9)

2020-08-26 Thread Ronald Oussoren via Python-ideas
> On 26 Aug 2020, at 17:02, krishnans2...@gmail.com wrote: > > One suggestion I had for the next Python release is to add type-implication > support. Many developers have learned Python, but do not want to use it since > it is slow. An awesome way to fix this is to have optional

[Python-ideas] Re: raise TypeError when giving wrong type of argument in functions

2020-08-22 Thread Ronald Oussoren via Python-ideas
> On 22 Aug 2020, at 15:00, rawmin...@gmail.com wrote: > > I wanted to know if there could be TypeError when giving wrong type for > arguments in functions > (This usually happens when using other module's function) > > e.g: > > def sum(nom1: int, nom2: int): > nom = nom1 + nom2 >

[Python-ideas] Re: Access (ordered) dict by index; insert slice

2020-07-10 Thread Ronald Oussoren via Python-ideas
> On 10 Jul 2020, at 15:38, Eric V. Smith wrote: > > > On 7/10/2020 9:20 AM, Paul Moore wrote: >> On Fri, 10 Jul 2020 at 13:47, Stestagg wrote: >> >>> The intent of my statement was: The current implementation of dict does not >>> allow any reasonable implementation of

[Python-ideas] Re: Access (ordered) dict by index; insert slice

2020-07-10 Thread Ronald Oussoren via Python-ideas
> On 10 Jul 2020, at 14:08, Stestagg wrote: > > > Adding indexing to views adds another requirement to the dict implementation: > > Yes, that's the proposed change > > indexing for sequences at least suggests that access is O(1). > That makes it impossible to use, as an example, a linked

[Python-ideas] Re: Access (ordered) dict by index; insert slice

2020-07-10 Thread Ronald Oussoren via Python-ideas
> On 10 Jul 2020, at 05:33, Christopher Barker wrote: > > On Thu, Jul 9, 2020 at 10:29 AM Stestagg > wrote: > The idea that there are future, unspecified changes to dicts() that may or > may not be hampered by allowing indexing sounds like FUD to me, unless there

[Python-ideas] Re: Add builtin function for min(max())

2020-07-09 Thread Ronald Oussoren via Python-ideas
> On 9 Jul 2020, at 21:04, Ethan Furman wrote: > > On 07/03/2020 05:03 PM, Steven D'Aprano wrote: > >> def clamp(value, lower, upper): >> """Clamp value to the closed interval lower...upper. >> The limits lower and upper can be set to None to >> mean -∞ and +∞

[Python-ideas] Re: Python, Be Bold!

2020-01-06 Thread Ronald Oussoren via Python-ideas
> On 5 Jan 2020, at 22:41, Andrew Barnert via Python-ideas > wrote: > > On Jan 5, 2020, at 00:17, James Lu wrote: >> >>  >> I use macOS, and using Python is very confusing. >> >> - Apple's bundled Python 2.7. > > Apple has made a mess of things, but they’ve actually fixed that mess in >

[Python-ideas] Re: adding support for a "raw output" in JSON serializer

2019-08-08 Thread Ronald Oussoren via Python-ideas
> On 8 Aug 2019, at 12:22, Richard Musil wrote: > > I have found myself in an awkward situation with current (Python 3.7) JSON > module. Basically it boils down to how it handles floats. I had been hit on > this particular case: > > In [31]: float(0.6441726684570313) > Out[31]:

[Python-ideas] Re: Scope painting

2019-07-19 Thread Ronald Oussoren via Python-ideas
Op 18 jul. 2019 om 03:41 heeft Yonatan Zunger het volgende geschreven: > Hi everyone, > > I'm in the middle of developing a fancy heap profiler for Python (for those > times when tracemalloc isn't enough), and in the process, thought of a small > change in the interpreter which could have

Re: [Python-ideas] Vectorization [was Re: Add list.join() please]

2019-02-03 Thread Ronald Oussoren via Python-ideas
> On 3 Feb 2019, at 21:34, David Mertz wrote: > > On Sun, Feb 3, 2019 at 3:16 PM Ronald Oussoren <mailto:ronaldousso...@mac.com>> wrote: > The @ operator is meant for matrix multiplication (see PEP 465) and is > already used for that in NumPy. IMHO just that

Re: [Python-ideas] Vectorization [was Re: Add list.join() please]

2019-02-03 Thread Ronald Oussoren via Python-ideas
> On 3 Feb 2019, at 09:54, Adrien Ricocotam wrote: > > Nice that you implemented it ! > > I think all the issues you have right now would go of using another > operation. I proposed the @ notation that is clear and different from > everything else, > plus the operator is called "matmul" so

Re: [Python-ideas] Using sha512 instead of md5 on python.org/downloads

2018-12-08 Thread Ronald Oussoren via Python-ideas
> On 8 Dec 2018, at 05:14, Steven D'Aprano wrote: > > On Sat, Dec 08, 2018 at 11:05:43AM +0900, INADA Naoki wrote: > >> We already use SHA256 on PyPI. >> Many project in the world moving from md5 to SHA256. > [...] > > > How easy is it to use sha256 on the major platforms, compared to md5?

Re: [Python-ideas] Make "yield" inside a with statement a SyntaxError

2018-08-08 Thread Ronald Oussoren via Python-ideas
> On 8 Aug 2018, at 14:35, Rhodri James wrote: > > On 08/08/18 07:14, Ken Hilton wrote: >> Now, let's take a look at the following scenario: >> def read_multiple(*filenames): >> for filename in filenames: >> with open(filename) as f: >> yield f.read() >>

Re: [Python-ideas] The future of Python parallelism. The GIL. Subinterpreters. Actors.

2018-07-18 Thread Ronald Oussoren via Python-ideas
Op 18 jul. 2018 om 08:02 heeft Barry het volgende geschreven: > > >>> On 17 Jul 2018, at 21:00, Eric Snow wrote: >>> >>> On Tue, Jul 17, 2018 at 1:44 PM Barry wrote: >>> The decrement itself is not the problem, that can be made thread safe. >> >> Yeah, by using the GIL. Otherwise,

Re: [Python-ideas] [issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-22 Thread Ronald Oussoren
On 21 Jun 2018, at 09:17, Stephen J. Turnbull wrote:Ronald Oussoren writes:Possibly just for the “cp…” encodings, but IMHO only if we confirmthat the code to look for the preferred encoding returns a codepagenumber on Windows and changing that code leads to worse resultsthan adding numeric

Re: [Python-ideas] [issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-18 Thread Ronald Oussoren
> On 18 Jun 2018, at 02:34, Steven D'Aprano wrote: > >> Sure, but for at least one user Python 3.6 fails to start because >> initialising the sys.std* streams fails due to not finding a “874” >> encoding. > > That doesn't mean that the bug is best fixed by adding an alias. I agree, I’ve

Re: [Python-ideas] Fwd: Trigonometry in degrees

2018-06-11 Thread Ronald Oussoren
Op 11 jun. 2018 om 09:18 heeft Jacco van Dorp het volgende geschreven: >> Remember, because π is irrational, we cannot actually call sin or cos on >> any rational multiple of π. We can only operate on multiples of pi, >> which is *close to* but not the same as π. That's why it is okay that >>

Re: [Python-ideas] PEP 447: Adding type.__getdescriptor__

2017-12-03 Thread Ronald Oussoren
> On 3 Dec 2017, at 03:58, Nick Coghlan <ncogh...@gmail.com> wrote: > > On 2 December 2017 at 01:12, Ronald Oussoren <ronaldousso...@mac.com> wrote: >> On 1 Dec 2017, at 12:29, Nick Coghlan <ncogh...@gmail.com> wrote: >>> 2. Define it

Re: [Python-ideas] PEP 447: Adding type.__getdescriptor__

2017-12-01 Thread Ronald Oussoren
> On 1 Dec 2017, at 12:29, Nick Coghlan <ncogh...@gmail.com> wrote: > > On 1 December 2017 at 21:04, Ronald Oussoren <ronaldousso...@mac.com> wrote: >> The second question is more a design question: what’s the better design, >> having __getdescriptor__ as a cla

Re: [Python-ideas] PEP 447: Adding type.__getdescriptor__

2017-12-01 Thread Ronald Oussoren
> On 1 Dec 2017, at 11:32, Nick Coghlan <ncogh...@gmail.com> wrote: > > On 1 December 2017 at 19:15, Ronald Oussoren <ronaldousso...@mac.com> wrote: > >> Maybe, but how would this work with super()? Super walks the MRO of type of >> the inst

Re: [Python-ideas] PEP 447: Adding type.__getdescriptor__

2017-12-01 Thread Ronald Oussoren
> On 1 Dec 2017, at 07:01, Nick Coghlan <ncogh...@gmail.com> wrote: > > On 1 December 2017 at 01:23, Ronald Oussoren <ronaldousso...@mac.com> wrote: >> 1) Last time around Mark Shannon worried that this introduces infinite >> recursion in the language itself (

[Python-ideas] PEP 447: Adding type.__getdescriptor__

2017-11-30 Thread Ronald Oussoren
Hi, I’m trying to get up to speed again w.r.t. PEP 447 (and to be honest, with CPython’s development workflow as its been too long since I’ve actually done work on the CPython codebase…). Let me start by recapping the PEP (

Re: [Python-ideas] PEP 554: Stdlib Module to Support Multiple Interpreters in Python Code

2017-09-10 Thread Ronald Oussoren
> On 8 Sep 2017, at 05:11, Eric Snow wrote: > On Thu, Sep 7, 2017 at 3:48 PM, Nathaniel Smith wrote: > >> Numpy is the one I'm >> most familiar with: when we get subinterpreter bugs we close them >> wontfix, because supporting subinterpreters

Re: [Python-ideas] Alternative Unicode implementations (NSString/NSMutableString)

2017-07-19 Thread Ronald Oussoren
> On 19 Jul 2017, at 00:35, Jim J. Jewett <jimjjew...@gmail.com> wrote: > > Ronald Oussoren came up with a concrete use case for wanting the > interpreter to consider something a string, even if it isn't > implemented with the default datastructure. > > In https:

Re: [Python-ideas] PEP: Hide implementation details in the C API

2017-07-12 Thread Ronald Oussoren
> On 11 Jul 2017, at 12:19, Victor Stinner wrote: > > Hi, > > This is the first draft of a big (?) project to prepare CPython to be > able to "modernize" its implementation. Proposed changes should allow > to make CPython more efficient in the future. The

Re: [Python-ideas] Exposing CPython's subinterpreter C-API in the stdlib.

2017-05-26 Thread Ronald Oussoren
> On 25 May 2017, at 19:03, Eric Snow wrote: > > On Wed, May 24, 2017 at 8:30 PM, Guido van Rossum wrote: >> Hm... Curiously, I've heard a few people at PyCon > > I'd love to get in touch with them and discuss the situation. I've > spoken with