[Python-ideas] Re: commonprefix

2024-06-17 Thread Rob Cliffe via Python-ideas
case. Thoughts? Best wishes Rob Cliffe ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.o

[Python-ideas] Re: commonprefix

2024-06-17 Thread Rob Cliffe via Python-ideas
rong.  os.path.commonprefix uses min and max, not sort.  I withdraw it: I also suspect that this function could be made more efficient.  It sorts the sequence.  While sorting is very fast (thanks, Uncle Tim!) it seems a bit OTT in this case. Thoughts? Best wishes Rob Cliffe ____

[Python-ideas] commonprefix

2024-06-12 Thread Rob Cliffe via Python-ideas
seems a bit OTT in this case. Thoughts? Best wishes Rob Cliffe _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at http

[Python-ideas] Re: Abstract dataclasses and dataclass fields

2023-12-22 Thread DL Neil via Python-ideas
On 12/23/23 09:51, Chris Angelico wrote: On Sat, 23 Dec 2023 at 07:13, DL Neil via Python-ideas wrote: On 12/23/23 02:09, Eric V. Smith via Python-ideas wrote: On 12/21/2023 4:38 PM, Steve Jorgensen wrote: I am finding that it would be useful to be able to define a dataclass that is an

[Python-ideas] Re: Abstract dataclasses and dataclass fields

2023-12-22 Thread DL Neil via Python-ideas
taclasses-and-properties-in-python Let's also state, and discard, the idea that there is no need (from Python's perspective) for an ABC at all, creating a super-(data)class, and inheriting from there 'works' - but doesn't help comprehension. -- Regards =dn _

[Python-ideas] Re: Abstract dataclasses and dataclass fields

2023-12-22 Thread DL Neil via Python-ideas
On 12/23/23 02:09, Eric V. Smith via Python-ideas wrote: On 12/21/2023 4:38 PM, Steve Jorgensen wrote: I am finding that it would be useful to be able to define a dataclass that is an abstract base class and define some of its field as abstract. As I am typing this, I realize that I could

[Python-ideas] Re: Abstract dataclasses and dataclass fields

2023-12-22 Thread Eric V. Smith via Python-ideas
st is basically dead. And when you do post over there, please provide an example. It's not clear what would happen in the generated code if abstract=True. Eric _______ Python-ideas mailing list -- [email protected] To unsubscribe send an emai

[Python-ideas] Re: Extract variable name from itself

2023-11-08 Thread anthony.flury via Python-ideas
o the user_name variable will only have the name 'person_name', but not user_name, as the field objects need to know their names on the model (and their names on the views/forms). -- Original Message -- From: "Rene Nejsum" To: [email protected] Sent: Saturday,

[Python-ideas] Re: re.match(pattern, string, require=True)

2023-10-22 Thread Eric V. Smith via Python-ideas
nt line. Eric _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-i

[Python-ideas] Re: Descriptor __get__ and __set__ argument discrepancy

2023-10-19 Thread dn via Python-ideas
On 19/10/2023 20.43, Dom Grigonis wrote: On 19 Oct 2023, at 10:27, dn via Python-ideas wrote: On 19/10/2023 19.50, Dom Grigonis wrote: Thank you, Good information, thank you. Was not aware of __set_name__. IIRC that was one of the updates/improvements. Thanks to whomsoever...! The

[Python-ideas] Re: Descriptor __get__ and __set__ argument discrepancy

2023-10-19 Thread dn via Python-ideas
to make use of them in our application code... (YMMV!) -- Regards, =dn _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/

[Python-ideas] Re: Descriptor __get__ and __set__ argument discrepancy

2023-10-18 Thread dn via Python-ideas
/datamodel.html#descriptors -- Regards, =dn _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://

[Python-ideas] Re: SyntaxError: cannot use assignment expressions with attribute

2023-10-10 Thread Rob Cliffe via Python-ideas
(self.mode := self.mode_valid(mode)) _______ Python-ideas mailing list [email protected] To unsubscribe send an email [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived athttps://mail.python.org/ar

[Python-ideas] Re: Reconstructing datetime from microsecond timestamp

2023-09-25 Thread Samuel Freilich via Python-ideas
p> wrote: > Samuel Freilich via Python-ideas writes: > > > This might all be too much thought about edge cases that don't > > matter, but given the *_ns() functions in the time module (PEP > > 564), I'm curious why datetime doesn't have a constructor

[Python-ideas] Reconstructing datetime from microsecond timestamp

2023-09-24 Thread Samuel Freilich via Python-ideas
on that supports. Peace, -Sam _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/p

[Python-ideas] Re: Extract variable name from itself

2023-09-23 Thread Eric V. Smith via Python-ideas
this in editor (see my later e-mails)2. The f-string functionality for it is already there: f'{a=}'.rstrip(f'{a}') # or a bit better f'{a=}'.split('=')[0] # = exactly what I am proposing (Except the unneeded evaluation part) So if it is already ther

[Python-ideas] Re: Extract variable name from itself

2023-09-12 Thread Rob Cliffe via Python-ideas
nt("Your variable name is "+ variable_name) it does "work", but it doesn't make much sense with Python's semantics.  You could have two identifiers bound to the same object; which one you got hold of would be essentially random. Puzzled. Rob Cliffe__

[Python-ideas] Re: Extract variable name from itself

2023-09-12 Thread Rob Cliffe via Python-ideas
27; but not the other, though I would be surprised if that happened in practice.  The behaviour is not guaranteed and should not be relied on. Rob Cliffe_______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas

[Python-ideas] Re: Have del return a value

2023-09-11 Thread Rob Cliffe via Python-ideas
large memory footprint that is only needed temporarily. Best wishes Rob Cliffe___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python

[Python-ideas] Re: Have del return a value

2023-09-11 Thread Rob Cliffe via Python-ideas
large memory footprint that is only needed temporarily. Best wishes Rob Cliffe PS Ooh, not quite true.  I have used it to delete a variable that should no longer be needed to detect accidental illegitimate use of said variable. RC___ Python-ideas

[Python-ideas] Re: factory for sentinel objects

2023-08-31 Thread Tim Hoffmann via Python-ideas
ch in the right direction. Will continue discussing in this context. > Matthias Görgens hat am 31.08.2023 11:29 CEST > geschrieben: > > > Seems nice. Just write a library and upload it to one of the usual places? > ___________ Py

[Python-ideas] factory for sentinel objects

2023-08-31 Thread Tim Hoffmann via Python-ideas
not rocket science, getting sentinels correct is cumbersome for end users. Providing such a function in the standard library is only a minor maintainance burden, but a significant help for users working with sentinels. Thanks for your consideration! Tim___

[Python-ideas] Re: factory for sentinel objects

2023-08-31 Thread Tim Hoffmann via Python-ideas
; '__repr__': lambda self: f"<{self.__class__.__name__}>", > '__copy__': lambda self: self, > '__deepcopy__': lambda self, memo: self, > }) > > Likely, the implementation should be refined a bit more. >

[Python-ideas] Re: while(tt--)

2023-08-11 Thread Rob Cliffe via Python-ideas
On 04/08/2023 14:02, Niktar Lirik via Python-ideas wrote: Hi Daniil. Yes, you can do almost same:     tt = 5     while tt := tt - 1:     print(tt) "almost" is right.  The OP's version, as far as I can tell, wants to do post-decrement (test tt, then decrement it)

[Python-ideas] Re: Conditional 1-line expression in python

2023-08-05 Thread Rob Cliffe via Python-ideas
r 3-question poll. https://q5yitzu62.supersurvey.com Would be interesting to see if my preference is an outlier or not really. Kind regards, D. Grigonis ___ Python-ideas mailing list [email protected] To unsubscribe send an email topy

[Python-ideas] Re: while(tt--)

2023-08-04 Thread Niktar Lirik via Python-ideas
something like this: tt = 5 while (tt--): # do something It is exists in C++. And in my opinion it is very Pythonic ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https

[Python-ideas] Re: else without except

2023-08-01 Thread Ronald Oussoren via Python-ideas
how a new feature would improve realistic code patterns helps to defend to proposal. Ronald — Twitter / micro.blog: @ronaldoussoren Mastodon: @[email protected]. Blog: https://blog.ronaldoussoren.net/ _______ Python-ideas mailing list -- pyt

[Python-ideas] Re: "Curated" package repo?

2023-07-24 Thread James Addison via Python-ideas
On Sun, Jul 9, 2023, 23:35 Christopher Barker wrote: > On Sun, Jul 9, 2023 at 8:37 AM James Addison via Python-ideas < > [email protected]> wrote: > >> ISTM the primary use cases advanced here have been for "naive" users. >>>> Likely they won'

[Python-ideas] Re: Proposal for get_or function in Python dictionaries

2023-07-24 Thread anthony.flury via Python-ideas
nd invoked once. -- Original Message -- From: "Rob Cliffe via Python-ideas" To: "Dom Grigonis" ; "Jothir Adithyan" Cc: [email protected] Sent: Monday, 17 Jul, 23 At 16:09 Subject: [Python-ideas] Re: Proposal for get_or function in Python dictionari

[Python-ideas] Re: Proposal for get_or function in Python dictionaries

2023-07-19 Thread James Addison via Python-ideas
On Thu, Jul 20, 2023, 01:19 Rob Cliffe via Python-ideas < [email protected]> wrote: > > > On 15/07/2023 21:08, Dom Grigonis wrote: > > Just to add. I haven’t thought about evaluation. Thus, to prevent > evaluation of unnecessary code, introduction of C-style expres

[Python-ideas] Re: Proposal for get_or function in Python dictionaries

2023-07-19 Thread Rob Cliffe via Python-ideas
does exactly the same as the C version and is more readable.  Or am I missing something? Best wishes Rob Cliffe___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.pytho

[Python-ideas] Re: "Curated" package repo?

2023-07-09 Thread James Addison via Python-ideas
On Sun, Jul 9, 2023, 16:25 Paul Moore wrote: > > > On Sun, 9 Jul 2023 at 15:56, Stephen J. Turnbull < > [email protected]> wrote: > >> James Addison via Python-ideas writes: >> >> > The implementation of such a system could either be c

[Python-ideas] Re: "Curated" package repo?

2023-07-09 Thread James Addison via Python-ideas
packaging infrastructure. On Sun, Jul 9, 2023, 16:09 James Addison wrote: > On Sun, Jul 9, 2023, 15:52 Stephen J. Turnbull < > [email protected]> wrote: > >> James Addison via Python-ideas writes: >> >> > The implementation of such a system co

[Python-ideas] Re: "Curated" package repo?

2023-07-09 Thread James Addison via Python-ideas
On Sun, Jul 9, 2023, 15:52 Stephen J. Turnbull < [email protected]> wrote: > James Addison via Python-ideas writes: > > > The implementation of such a system could either be centralized or > > distributed; the trust signals that human users infer from

[Python-ideas] Re: "Curated" package repo?

2023-07-09 Thread James Addison via Python-ideas
On Sun, Jul 9, 2023, 09:13 Chris Angelico wrote: > On Sun, 9 Jul 2023 at 18:06, James Addison via Python-ideas > wrote: > > > > On Sun, 9 Jul 2023 at 02:11, Cameron Simpson wrote: > > > I have always thought that any community scoring system should allow > > &g

[Python-ideas] Re: "Curated" package repo?

2023-07-09 Thread James Addison via Python-ideas
That would not be mutually-exclusive with the presence of reviews -- verbal, written, or otherwise -- elsewhere. Thanks, James [1] - https://github.com/jazzband/pip-tools/ [2] - https://www.reproducible-builds.org/ ___ Python-ideas mailing list -- pyth

[Python-ideas] Re: "Curated" package repo?

2023-07-06 Thread James Addison via Python-ideas
hird party module on a UEFI >> interface. >> >> On Thu, Jul 6, 2023 at 9:11 AM James Addison via Python-ideas < >> [email protected]> wrote: >> >>> On Wed, Jul 5, 2023, 19:06 Chris Angelico wrote: >>> >>>> On Thu, 6 Jul 2023

[Python-ideas] Re: "Curated" package repo?

2023-07-06 Thread James Addison via Python-ideas
ty use cases. > > I don’t want to load a hash table to load a third party module on a UEFI > interface. > > On Thu, Jul 6, 2023 at 9:11 AM James Addison via Python-ideas < > [email protected]> wrote: > >> On Wed, Jul 5, 2023, 19:06 Chris Angelico wrote: >>

[Python-ideas] Re: "Curated" package repo?

2023-07-06 Thread James Addison via Python-ideas
On Wed, Jul 5, 2023, 19:06 Chris Angelico wrote: > On Thu, 6 Jul 2023 at 03:57, James Addison via Python-ideas > wrote: > > I also agree with a later reply about avoiding the murkier side of > blockchains / etc. That said, it seems to me (again, sample size one > anecdata) th

[Python-ideas] Re: "Curated" package repo?

2023-07-05 Thread James Addison via Python-ideas
CHB > > [*] maybe not, actually -- once the infrastructure was in place, adding a > package would require someone requesting that it be added, and someone on a > "core team" approving it. That could be a pretty low level of effort, > actually. The actual mechanism would be to

[Python-ideas] Re: [dataclasses] add a NON_FIELDS sentinel after which all attributes are ignored.

2023-06-23 Thread Eric V. Smith via Python-ideas
But without knowing the use case, it's hard to say. Eric _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at http

[Python-ideas] Re: [dataclasses] add a NON_FIELDS sentinel after which all attributes are ignored.

2023-06-23 Thread Eric V. Smith via Python-ideas
ld attribute. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python

[Python-ideas] Re: Warn when iterating over an already exhausted generator

2023-06-13 Thread BoppreH via Python-ideas
____ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/KAF

[Python-ideas] Re: Warn when iterating over an already exhausted generator

2023-06-13 Thread BoppreH via Python-ideas
Sorry, I'm new to the list and was not aware the burden of proof was so high. Can you point me to one or two successful posts in Python-ideas where I can learn how to show there's a real need for a feature? On Tue, Jun 13, 2023, at 11:25 PM, Chris Angelico wrote: > On Wed, 14 Jun

[Python-ideas] Re: Warn when iterating over an already exhausted generator

2023-06-13 Thread BoppreH via Python-ideas
ed numbers. > 2. If I wanted unmodified list and if it was modified then it is an error, > your solution doesn’t work either. > 3. If sorting is ok only on non-empty iterator, then just `assert sorted` > after sorting. > > If you could give a full real-life scenario, then i

[Python-ideas] Re: Warn when iterating over an already exhausted generator

2023-06-13 Thread BoppreH via Python-ideas
would already be helpful, like Go's race condition detector. -- BoppreH_______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at http

[Python-ideas] Re: Warn when iterating over an already exhausted generator

2023-06-13 Thread BoppreH via Python-ideas
via Python-ideas wrote: > > Also the OP's request was for generators, not for any iterator. > > IMO it would be a bad idea to make generators behave differently > from other iterators in this regard. And it's far too late to > redefine the iterator protocol in general, becaus

[Python-ideas] Re: Undefined type

2023-06-12 Thread Rob Cliffe via Python-ideas
ilar encounters? _______ Python-ideas mailing list [email protected] To unsubscribe send an email [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived athttps://mail.python.org/archives/list/python-ideas@pyt

[Python-ideas] Re: Warn when iterating over an already exhausted generator

2023-06-12 Thread Rob Cliffe via Python-ideas
On 12/06/2023 21:11, Barry wrote: On 12 Jun 2023, at 16:55, BoppreH via Python-ideas wrote: Then the empty list creates hard-to-track bugs. I'm familiar with the iterator protocol and why the behavior above happens, but couldn't it be prevented? I don’t think so. It is not al

[Python-ideas] Re: Warn when iterating over an already exhausted generator

2023-06-12 Thread BoppreH via Python-ideas
empty list. BoppreH On Mon, Jun 12, 2023, at 10:11 PM, Barry wrote: > > > > On 12 Jun 2023, at 16:55, BoppreH via Python-ideas > > wrote: > > > > Then the empty list creates hard-to-track bugs. I'm familiar with the > > iterator protocol and why the

[Python-ideas] Warn when iterating over an already exhausted generator

2023-06-12 Thread BoppreH via Python-ideas
when calling `__iter__` on an exhausted generator? _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python

[Python-ideas] Re: Make ellipsis an indicator of missing implementation

2023-05-03 Thread Rob Cliffe via Python-ideas
sError: Implementation of `my_fun` is not finished. ``` This change could break some code, as for now ellipsis in the middle of code is silently ignored, but I don't think anybody seriously relies on that behavior. haael ___________ Python-ideas mail

[Python-ideas] Re: Allowing `str.format` to format one or more parameters instead of all parameters

2023-04-25 Thread Rob Cliffe via Python-ideas
parameter `color` Is there any reason you can't write pfr =r"\mathjax{{color}}{{text}}".replace("{color}", "blue") result =r"\mathjax{{color}}{{text}}".replace("{text}", "Spanish") Best wishes Rob Cliffe

[Python-ideas] new PEP: implementation independent native code invocation and data exchange ABI standard (not sure if accurate)

2023-04-23 Thread Evan Greenup via Python-ideas
nor I/O operations is involved. It just make some basic data representation conversion and invoke the method in dynamic library. This is just a raw idea. If it is valuable, it can take a discussion and make further steps. Thanks_______ Python-ideas mailing

[Python-ideas] Python should add "__name__" and "__doc__" attributes to "functools.partial"

2023-04-17 Thread Matteo Raso via Python-ideas
should make it much easier to use "partial" in the future. Thanks for your consideration. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3

[Python-ideas] Re: len(Enum) should raise TypeError

2023-04-04 Thread James Addison via Python-ideas
ols (such as pylint) detect a potential problem with the code? Thanks, James ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.

[Python-ideas] Re: An interface for `mro` methods similar to the interface for `iter`, `getattr`, etc...

2023-03-24 Thread Rob Cliffe via Python-ideas
t; object.__mro__ (,) Best wishes Rob Cliffe_______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived

[Python-ideas] Re: join() could add separators at start or end

2023-03-14 Thread Rob Cliffe via Python-ideas
uivalent solution is easier to understand and to write, and will lead to way less confusion about what join() actually does. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail

[Python-ideas] Native support of YAML in Python STDLIB

2023-03-13 Thread scott.fields--- via Python-ideas
supporting YAML, I would think it time for Python to formally adopt this technology in the core foundation. Is there still a reason why this isn't being pursued as native infrastructure in Python? ___ Python-ideas mailing list -- python-

[Python-ideas] Re: Ampersand operator for strings

2023-03-12 Thread Rob Cliffe via Python-ideas
or s in middle), last.lstrip())) What is harder is to be sure that this would be the expected behaviour when using a `&` operator on strings. Why `'   a' & 'b'` would produce `'a b'` and `'   ' & 'b'` produce `' b'` for exam

[Python-ideas] Re: Ampersand operator for strings

2023-03-11 Thread Rob Cliffe via Python-ideas
it is trickier still. As it is so easy to get these things wrong, perhaps having it built in is not such a terrible idea?😁 Best wishes Rob Cliffe In any case I recommend reaching out for a library like Rich (https://github.com/Textualize/rich) if you care about formatting the output

[Python-ideas] Re: join() could add separators at start or end

2023-03-09 Thread Rob Cliffe via Python-ideas
On 09/03/2023 05:25, Bruce Leban wrote: On Wed, Mar 8, 2023 at 4:34 PM Rob Cliffe via Python-ideas wrote: It seems to me that it would be useful to be able to make the str.join() function put separators, not only between the items of its operand, but also optionally at

[Python-ideas] Re: Ampersand operator for strings

2023-03-08 Thread Rob Cliffe via Python-ideas
, Rob! 😬) A few reasonably representative examples: Lib\cgitb.py:106:     pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable     pyver = 'Python' & sys.version.split()[0] + ':' & sys.executable Lib\ftplib.py:289:     cmd =

[Python-ideas] join() could add separators at start or end

2023-03-08 Thread Rob Cliffe via Python-ideas
site-packages\twisted\mail\test\test_pop3.py:376: output = b'\r\n'.join(client.response) + b'\r\n' Lib\site-packages\twisted\mail\test\test_smtp.py:100:    message = b'\n'.join(self.buffer) + b'\n' Lib\site-packages\twisted\mail\test\test_smtp.py:344:    m

[Python-ideas] Re: Ampersand operator for strings

2023-03-07 Thread Rob Cliffe via Python-ideas
You make a very powerful point, Bruce.  Much more so IMO than anyone else has so far. Unless anyone else can find a convincing rebuttal, I withdraw my proposal. Best wishes Rob Cliffe On 07/03/2023 21:49, Bruce Leban wrote: On Sun, Mar 5, 2023 at 7:39 PM Rob Cliffe via Python-ideas wrote

[Python-ideas] Re: Ampersand operator for strings

2023-03-07 Thread Rob Cliffe via Python-ideas
by (at least) one space.  Bear with me while I repeat it: Lib\site-packages\numpy\distutils\system_info.py:2677:     cmd = config_exe + ' ' + self.append_config_exe + ' ' + option     cmd = config_exe & self.append_config_exe & option Best wishes Rob Cliffe

[Python-ideas] Re: Ampersand operator for strings

2023-03-06 Thread Rob Cliffe via Python-ideas
typing.  Just sayin'. Best wishes Rob Cliffe I admit that I use M-SPC (aka just-one-space) lot in Emacsen, but I can't recall wanting it in a program in any language. _______ Python-ideas mailing list -- [email protected] To unsubscribe send

[Python-ideas] Ampersand operator for strings

2023-03-05 Thread Rob Cliffe via Python-ideas
nk it is better if it strips off all whitespace,    so that it can be understood as working similarly to strip().    (2) The definition could be simplified to        s1.rstrip() + ' ' + s2.lstrip()    (leave an initial/final space when one string is whitespace only).   

[Python-ideas] Re: Proposal: -X importcache to supplement -X importtime for loaded modules

2023-02-27 Thread James Addison via Python-ideas
gards, James ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python

[Python-ideas] Re: Restricting access to sensitive APIs with a permission model like Deno

2023-02-27 Thread python--- via Python-ideas
Makes sense, will do so. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org

[Python-ideas] Re: Restricting access to sensitive APIs with a permission model like Deno

2023-02-27 Thread python--- via Python-ideas
I really appreciate the pointers, thank you. I will look into them. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org

[Python-ideas] Re: Restricting access to sensitive APIs with a permission model like Deno

2023-02-27 Thread python--- via Python-ideas
ou provide me with an example or two? If I understand it correctly, only FFI would be able to do so, am I right? Regards, Aarnav _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https

[Python-ideas] Re: Restricting access to sensitive APIs with a permission model like Deno

2023-02-27 Thread python--- via Python-ideas
t audit and run this (or atleast read the code) since it's required to have a meaningful discussion, the overriding happens before the module resolution itself so sys.path is irrelevant. _______ Python-ideas mailing list -- [email protected] To uns

[Python-ideas] Re: Restricting access to sensitive APIs with a permission model like Deno

2023-02-26 Thread python--- via Python-ideas
__. code is not necessary but just pointers. Thanks and regards, Aarnav _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Mess

[Python-ideas] Re: Restricting access to sensitive APIs with a permission model like Deno

2023-02-26 Thread python--- via Python-ideas
rting them. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/p

[Python-ideas] Re: Restricting access to sensitive APIs with a permission model like Deno

2023-02-26 Thread python--- via Python-ideas
eny the request automatically which makes sense in a server-side application. I hope this answers your questions. I am happy to elaborate if not. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas-le...@p

[Python-ideas] Re: Restricting access to sensitive APIs with a permission model like Deno

2023-02-26 Thread python--- via Python-ideas
295:cpython:policy Regards, Aarnav _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org

[Python-ideas] Restricting access to sensitive APIs with a permission model like Deno

2023-02-26 Thread python--- via Python-ideas
here: https://github.com/R9295/cpython Currently, it only prevents module imports in a very elementary manner but perhaps it can be of use to spark a discussion for an implementation. Looking forward to your thoughts, Aarnav ___ Python-ideas mailing

[Python-ideas] Re: Combinations of keywords

2023-02-21 Thread James Addison via Python-ideas
port A_UNIX_MODULE on ImportError >>> try value = int(x[2]) but value = 0 on IndexError, ValueError ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/ma

[Python-ideas] Re: Deprecate misleading escapes in strings

2023-02-16 Thread Eric V. Smith via Python-ideas
ke non-meaningful backslashes > illegal in string literals' thread[3] could be revived as well, maybe > even with "\f\v" deprecated, "\e" = "\33" introduced and such. > > Please let me know what you think, what else could break, and

[Python-ideas] Re: Proposal: -X importcache to supplement -X importtime for loaded modules

2023-02-14 Thread anthony.flury via Python-ideas
cisions, but it seems if this really is only a couple of lines, and all the test cases pass this (or something very similar) should be a considered for 3.12. Thank you Noah, -- Original Message -- From: "Noah Kim" To: [email protected] Sent: Saturday, 11 Feb, 23 At 00:

[Python-ideas] Re: Multiple arguments to str.partition and bytes.partition

2023-01-09 Thread James Addison via Python-ideas
exactly-once while the input is scanned (also iterated) exactly-once _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at

[Python-ideas] Re: Multiple arguments to str.partition and bytes.partition

2023-01-08 Thread James Addison via Python-ideas
tand it, limited to at-most-one wildcard pattern per match (by sensible design). > I would prefer "one bite per call" partition > to a partition at multiple points. That does seem clearer - and clearer is, generally, probably better. I suppose an analysis (that I don'

[Python-ideas] Re: Multiple arguments to str.partition and bytes.partition

2023-01-08 Thread James Addison via Python-ideas
(rationale: that would allow either proposal to advance without delaying the other -- bearing in mind a hopefully-unlikely chance of merge conflicts if they reach release-readiness implementation status in parallel) _______ Python-ideas mailing list

[Python-ideas] Re: Multiple arguments to str.partition and bytes.partition

2023-01-08 Thread James Addison via Python-ideas
("?", "#")'? would it return a tuple of length five?) _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archi

[Python-ideas] Multiple arguments to str.partition and bytes.partition

2023-01-07 Thread James Addison via Python-ideas
.partition('@', ':') Beneficially for the caller, the number of tuple elements can be determined based on the number of positional arguments. For n arguments, a tuple of length 2n + 1 will be returned. Thank you for any and all feedback. James [1] - https://docs.python.org/3/li

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-23 Thread Rob Cliffe via Python-ideas
at: If you were subclassing str, you would probably want __str__ and __repr__ (if you were not overriding them) to return plain strings. Best wishes Rob Cliffe _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas-l

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-22 Thread Eric V. Smith via Python-ideas
-CHB -- Christopher Barker, PhD (Chris) Python Language Consulting   - Teaching   - Scientific Software Development   - Desktop GUI and Web Development   - wxPython, numpy, scipy, Cython ___ Python-ideas mailing list -- pyt

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-22 Thread Rob Cliffe via Python-ideas
rn mystr(str(self).upper()) s = mystr("hello") print(s.method())  # prints 1234 print(s.upper())   # prints HELLO print(s.upper().method())  # prints 1234 Best wishes Rob Cliffe___________ Python-ideas mailing list -- [email protected]

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-22 Thread Rob Cliffe via Python-ideas
)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> rf'{2+2}' '4' Best wishes Rob Cliffe _______ Python-ideas mailing list -- python-ideas@pyth

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-17 Thread Eric V. Smith via Python-ideas
next possible step > for this feature.) > > *Backwards compatibility* > This syntax currently raises a invalid syntax error. So introducing this > shouldn't break existing programs. Python's currently supported string types > are just single letter, so the suggestion i

[Python-ideas] Re: Idea: Tagged strings in python

2022-12-17 Thread C. Titus Brown via Python-ideas
> On Dec 17, 2022, at 10:08 AM, [email protected] wrote: > > Bruce Leban wrote: >>> Try googling "python-ideas string prefixes". Doing mimimal diligence is a >>> reasonable expectation before writing up an idea. > > Thanks for the query "stri

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

2022-12-14 Thread Ronald Oussoren via Python-ideas
mentation. Ronald — Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/m

[Python-ideas] Re: Enhancing variable scope control

2022-12-04 Thread Rob Cliffe via Python-ideas
On 04/12/2022 17:08, Chris Angelico wrote: On Mon, 5 Dec 2022 at 04:07, Rob Cliffe via Python-ideas wrote: On 30/11/2022 20:27, Anony Mous wrote: Danceswithmice wrote: The idea is that YOU write "local:", and the interpreter, without you ever seeing it, promotes that int

[Python-ideas] Re: Enhancing variable scope control

2022-12-04 Thread Rob Cliffe via Python-ideas
exited.  Again, this would be unexpected. Best wishes Rob Cliffe _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message

[Python-ideas] Re: Allow more flexibility for describing bytes objects.

2022-11-23 Thread Eric V. Smith via Python-ideas
the effort. That would be the beauty of 638: if it's important to one piece of code, it could be just enabled there. Of course the implementing macro would need to be either part of your application or become a dependency. But I'm under no delusions that this PEP will ever get accept

[Python-ideas] Allow more flexibility for describing bytes objects.

2022-11-23 Thread Ronald Hoogenboom via Python-ideas
etc. It just gives the programmer more freedom to specify literal bytes objects in the source code. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/

[Python-ideas] Custom unpickler and pickler for the shelve module

2022-11-17 Thread furkanonder via Python-ideas
Unpickler) as sh: squared = lambda x: x ** 2 sh['test_key'] = squared I could easily solve this problem I had while using the Shelve module. I believe that shelve module will be a more useful module by adding support for custom unpickler and pickler. Kindest regards, Furkan Onder_

[Python-ideas] Re: Void type

2022-07-27 Thread Eric V. Smith via Python-ideas
ssible to copy a > signature as is (with functools.wraps() and equivalents). > > ChrisA > ___ > Python-ideas mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org

[Python-ideas] Re: Void type

2022-07-25 Thread Anthony Flury via Python-ideas
n a function parameter it is not > processed: > > func(Void) == func() == "default" > _______ > Python-ideas mailing list -- [email protected] > To unsubscribe send an email to [email protected] > ht

  1   2   3   4   5   6   7   8   9   10   >