[Python-ideas] Adding a .find() method to list

2022-05-07 Thread python-ideas
class MyList(list): def find(self, func, default=None): for i in self: if func(i): return i return default my_list = MyList(users) user_2 = my_list.find(lambda user: user['id'] == 2) print(user_2) # {'id': 2, 'name

[Python-ideas] Re: Add symlinks option at shutil.move parameters

2019-12-24 Thread python-ideas--- via Python-ideas
Well, I suppose it wants simlink=False. Anyway, why not change the signature of move to def move(src, dst, **kwargs): and change the call of copytree to copytree(src, real_dst, **kwargs) ? ___ Python-ideas mailing list -- [email protected] To

[Python-ideas] Re: Segmentation of string

2019-12-24 Thread python-ideas--- via Python-ideas
res ___ 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

[Python-ideas] Re: Segmentation of string

2019-12-24 Thread python-ideas--- via Python-ideas
i = 0 for size in sizes: elem.append(it_true[i:i+size]) i += size res.append(elem) return res _______ Python-ideas

[Python-ideas] Re: Add "elif" to "for_stmt" and "while_stmt"

2019-12-24 Thread python-ideas--- via Python-ideas
There's already: for i in range(j): if i > 5: ... else: ... else: ... ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected]

[Python-ideas] Re: Segmentation of string

2019-12-25 Thread python-ideas--- via Python-ideas
See my implementation, is generic and not only for strings. It could be added to more-itertools, I suppose: https://mail.python.org/archives/list/[email protected]/message/E452LQGA3XKU5ADPTG54XP36ENXDZN2B/ ___ Python-ideas mailing list -- python

[Python-ideas] Re: Segmentation of string

2019-12-25 Thread python-ideas--- via Python-ideas
nations(range(1, len_it), n-1) ) _______ 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/KYM

[Python-ideas] Re: Moving PEP 584 forward (dict + and += operators)

2019-12-25 Thread python-ideas--- via Python-ideas
put objects. Maybe I want to support also dict. In this way writing such function is much more hard. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mai

[Python-ideas] Re: Renaming json.load()

2019-12-25 Thread python-ideas--- via Python-ideas
h) as f: self._data_raw = json.load(f) Apart the `dict` check, this logic could be applied to a `json.deserialize()` function. Python let you function overloading more simple, so why not use it? ___ Python-ideas mailing list -- python-

[Python-ideas] Re: Moving PEP 584 forward (dict + and += operators)

2019-12-25 Thread python-ideas--- via Python-ideas
Andrew Barnert wrote: > On Dec 25, 2019, at 14:57, python-ideas--- via Python-ideas > [email protected] wrote: > > If I can spend my two cents, I think the fact the > > most of you prefer | is because is already how sets works. And IMHO it's a > > bit i

[Python-ideas] PEP for experimental/provisional features

2021-02-07 Thread sascha.schlemmer--- via Python-ideas
st don't get this way. - various degrees of: "solve the issue of contention over new languages features once and for all by introducing macros/preprocessors to the language": Against this I have just my personal plea "please don't turn python into lisp/c++". _

[Python-ideas] Re: PEP for experimental/provisional features

2021-02-07 Thread sascha.schlemmer--- via Python-ideas
t in PEP622 originally and if it were released this way would have been impossible to change later. ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/

[Python-ideas] Re: Alternate lambda syntax

2021-02-14 Thread anthony.flury via Python-ideas
t sight suggests that many will do so. If we were going to do this - and I am still on the fence - I think we should avoid anything that reads like it could be confused as an operator. _______ Python-ideas mailing list -- [email protected] To

[Python-ideas] Re: Fwd: [Python-Dev] Suggestion About Python Syntax

2021-03-03 Thread anthony.flury via Python-ideas
3Y6Z6RCAXW72Y4WPWZ6HN3MYVFJ/> Code of Conduct: http://python.org/psf/codeofconduct/ <http://python.org/psf/codeofconduct/> ___ Python-ideas mailing list [email protected] To unsubscribe send an email [email protected] http

[Python-ideas] allow initial comma

2021-03-12 Thread roland.puntaier--- via Python-ideas
? = pxeger wrote: = This is not the appropriate place to propose language changes. Try the [python-ideas](https://mail.python.org/mailman3

[Python-ideas] Python Idea - extension of 'with'

2021-04-08 Thread anthony.flury via Python-ideas
inally` clauses (or just `except` and `else` - do we need `finally` here). -- Anthony Flury *Moble*: +44 07743 282707 *Home*: +44 (0)1206 391294 *email*: [email protected] <mailto:[email protected]> <>_______ Python-ideas ma

[Python-ideas] Re: Python Idea - extension of 'with'

2021-04-09 Thread anthony.flury via Python-ideas
lt;mailto:[email protected]> <>___________ 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 htt

[Python-ideas] List comprehension operators

2021-12-14 Thread a.kolpakov2010--- via Python-ideas
It would be awesome to be able to create a list with just: li = [1—100] or li = [1 .. 100] ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists

[Python-ideas] Applications user/system directories functions

2021-12-15 Thread JGoutin via Python-ideas
tem: If the required directory is the systemd directory or user direcotry. This may also be implemented as an external library, but I am not sure I would like add add a dependency to my projects "just for this". I can implement this if people are interested with this feature. _____

[Python-ideas] Re: Applications user/system directories functions

2021-12-15 Thread JGoutin via Python-ideas
, but provides more dirs on it. _______ 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: Mapping unpacking assignment

2022-02-06 Thread layday--- via Python-ideas
ll no longer be able to dictionary-unpack it which will prove very frustrating. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.pytho

[Python-ideas] Re: Mapping unpacking assignment

2022-02-06 Thread layday--- via Python-ideas
erefore well-defined APIs), which is why it has wider applicability in JS. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ M

[Python-ideas] Re: Mapping unpacking assignment

2022-02-06 Thread layday--- via Python-ideas
ponding to your message. _______ 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] Missing expandvars equivalent in pathlib

2022-02-10 Thread anthony.flury via Python-ideas
0 EMAIL;PREF=1:[email protected] FN:Anthony Flury NICKNAME:Tony N:Flury;Anthony;;; TEL;TYPE=home;VALUE=TEXT:01206 391294 TEL;TYPE=cell;VALUE=TEXT:07743282707 UID:c00fc9c3-a56a-4584-8886-6466cf32b9c8 END:VCARD _______ Python-ideas mailing list -- p

[Python-ideas] Comparison operator support (>= and <=) for type

2019-06-14 Thread eminbugrasaral--- via Python-ideas
`, or `B <= C (if B is a subclass or itself of C)` Because, since == means equality check. With the same logic, a class wraps another class is actually greater than this class from its type. _______ Python-ideas mailing list -- [email protected] To

[Python-ideas] Add a `dig` method to dictionaries supporting the retrieval of nested keys

2019-08-29 Thread None via Python-ideas
und, avoiding `KeyError`. Thoughts? _______ 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.py

[Python-ideas] Re: Add a `dig` method to dictionaries supporting the retrieval of nested keys

2019-09-03 Thread None via Python-ideas
s way to do things)? ___ 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

[Python-ideas] Python should take a lesson from APL: Walrus operator not needed

2019-11-05 Thread martin_05--- via Python-ideas
t; (and perhaps other symbols) could be planned for Python 4. Clean, simple and forward-looking. That, to me, is a good solution. Today we have "=" and ":=" which, from my opinionated perspective, does not represent progress at all. [0] http://www.eecg.toronto.ed

[email protected]

2019-11-18 Thread ivanov_chris--- via Python-ideas
a string: `f"{x}{y}{z}{a}"` or for the more functional programmers out there folding a map `"".join(map(str, (x, y, z, a))` ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail

[Python-ideas] Re: Asyncio Future.set_result_threadsafe

2020-02-13 Thread Brianvanderburg2 via Python-ideas
work with threads, though there does seem to be a library janus which provides a thread-capbable queue object which could be another solution. -Original Message- From: Guido van Rossum To: Brian Allen Vanderburg II Cc: Python-Ideas Sent: Thu, Feb 13, 2020 1:18 am Subject: Re: [Python-

[Python-ideas] Control adding script path/CWD to sys.path

2020-02-24 Thread Brianvanderburg2 via Python-ideas
an option seem to be more flexible as it give the user of the script the ability to say "don't add this current directory to the python path" for existing scripts and modules without having to edit them, create a custom launcher script, or change directories, etc.____

[Python-ideas] Re: Control adding script path/CWD to sys.path

2020-02-26 Thread Brianvanderburg2 via Python-ideas
python.org/issue13475 One idea may be, when executing "python -m", check to see if the module is loaded from CWD, if so then have CWD added, but if the module is not loaded from CWD then not have it added. -Original Message- From: Nick Timkovich To: Brianvanderburg2 Cc: python-ideas@p

[Python-ideas] is a

2020-05-01 Thread gbs--- via Python-ideas
Maybe this has been considered at some point in the past? The "is [not] a|an" proposal would at least be a strong contender for "hardest thing to search for on the internet" lol. Thanks! Gavin _______ Python-ideas mailing list

[Python-ideas] Enhancement: Adding support for private and name mangled type hints in dataclasses module

2020-08-23 Thread zachb1996--- via Python-ideas
this something that other see the possibility of being added to python? (Also, I know name mangling isn't super common but I think it may as well be added alongside a private variable implementation)) _______ Python-ideas mailing list -- python

[Python-ideas] Re: Enhancement: Adding support for private and name mangled type hints in dataclasses module

2020-08-24 Thread zachb1996--- via Python-ideas
e dict attribute. Zach _______ 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/lis

[Python-ideas] Re: Suggestion: annotated exceptions

2020-09-26 Thread sascha.schlemmer--- via Python-ideas
de (that the user of the library will not see when using the library) is >perfectly fine. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/li

[Python-ideas] Re: Suggestion: annotated exceptions

2020-09-26 Thread sascha.schlemmer--- via Python-ideas
- but in terms of the functions api e.g. dividing by zero being a natural part of division that has to be handled somehow. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailma

[Python-ideas] Re: Suggestion: annotated exceptions

2020-09-26 Thread sascha.schlemmer--- 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/L5WR6CEP4T4IRMT43

[Python-ideas] propose index heap

2020-11-01 Thread master_lee 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/UBV7D3ZTVDDLCIMYJOEAN7

[Python-ideas] Re: A python_include() for cgi programming

2020-11-26 Thread Voltron via Python-ideas
ad()) Basically, it includes the file and keep the scope of all variables that came before this type of include statement. Very useful for this like a shared authentication file across an entire website of multiple files/pages. Happy Thanksgiving! _______

[Python-ideas] Simon's ideas [Was: How to respond to trolling (Guido van Rossum)]

2017-01-12 Thread Guyzmo via Python-ideas
kind and have some netiquette. 🙏 Thank you, -- Bernard `Guyzmo` Pratz ___________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] A more readable way to nest functions

2017-01-28 Thread zmo via Python-ideas
x: isinstance(x), range(0,3)` to be fed to `filter`, and not `range(0,3)` to be fed to `lambda x: isinstance(x, int)`? But then it would be just another way to introduce currying as a language feature with an operator, so we should then just discuss on how to add currying as a language syntax

Re: [Python-ideas] A more readable way to nest functions

2017-01-29 Thread zmo via Python-ideas
16:27PM +0100, zmo via Python-ideas wrote: > > This idea sounds fun, so as a thought experiment why not imagine one > > way of integrating it in what I believe would be pythonic enough. > This idea is sometimes called "the Collection Pipeline" design pattern, > and

Re: [Python-ideas] Fwd: Define a method or function attribute outside of a class with the dot operator

2017-02-10 Thread Guyzmo via Python-ideas
s about it, blog articles written and RTFW updated, so you'll get the info you'll need fastly. Cheers, -- Guyzmo ___________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] Optional argument to fnmatch functions treat * and ** differently

2017-02-28 Thread Aaron via Python-ideas
nmatch-and-recursive-path-match-with http://stackoverflow.com/questions/27726545/python-glob-but-against-a-list-of-strings-rather-than-the-filesystem I would appreciate any thoughts. Kind regards, Aaron _______ Python-ideas mailing list Pyth

Re: [Python-ideas] Expose a child factory using MappingProxyType in builtins

2017-02-28 Thread lucas via Python-ideas
; >>>>> But we also have something to manipulate dict as immutable >>>> datastructures: >>>>> >>>>>>>> from types import MappingProxyType as idict >>>>>>>&

Re: [Python-ideas] π = math.pi

2017-06-01 Thread Guyzmo via Python-ideas
ttp://lol.zoy.org/blog/2012/06/17/compose-key-on-os-x Then I wrote my own ~/.XCompose file with: : "π" U03C0 # GREEK SMALL LETTER PI so it's like the vim digraphs. Cheers, -- zmo _______ Python-ideas mailing

[Python-ideas] + operator on generators

2017-06-25 Thread lucas via Python-ideas
. (In pure python, the implementation would be something like `def __add__(self, othr): return itertools.chain(self, othr)`) Best regards, --lucas signature.asc Description: OpenPGP digital signature _______ Python-ideas mailing list Python

[Python-ideas] Add a replace method to tuples

2022-03-10 Thread wfdc via Python-ideas
-to-change-values-in-a-tuple for more context. Currently, tuples have 2 public methods: index and count. replace would be similarly easy to implement and similarly useful. Furthermore, it would be a natural counterpart to nametuple's _replace method._____

[Python-ideas] Re: Add a replace method to tuples

2022-03-10 Thread wfdc via Python-ideas
ot;batteries included" philosophy. If users find themselves re-implementing the same utility function over again and over again across different projects, it's a good sign that such a function should be part of the standard library. --- Original Message --- On Thursday, March

[Python-ideas] Re: Add a replace method to tuples

2022-03-10 Thread wfdc via Python-ideas
method. > > On the other hand, it might be an indication that a tuple is the wrong > > tool for the job. As noted, a namedtuple DOES allow you to replace one > > component, and to do so by name rather than knowing its index, so > > possibly that would be a better ch

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
way. See namedtuple's ._replace method. namedtuples are also immutable. We simply want the same functionality for tuple. --- Original Message --- On Friday, March 11th, 2022 at 4:41 AM, Paul Moore wrote: > On Fri, 11 Mar 2022 at 02:20, wfdc via Python-ideas > > python-idea

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
s not mean it shouldn't be built-in. >> >> See Python's "batteries included" philosophy. > > "Not every 1-line function needs to be a built-in". > >> If users find themselves re-implementing the same utility function over >> again an

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
> would be in my top five considerations. > > But if you want it, subclassing is a thing. > > On Fri, Mar 11, 2022, 2:14 PM wfdc via Python-ideas > wrote: > >>> one Stack Overflow question, with a low number of votes >> >> Mind explaining why you say 159 i

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
nal Message --- On Friday, March 11th, 2022 at 2:36 PM, Chris Angelico wrote: > On Sat, 12 Mar 2022 at 06:33, wfdc via Python-ideas > > [email protected] wrote: > > > > But humans can be confused by "replace" having a totally different API in > &g

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
of times. > > I'd call the purpose rare at best. > > I'm not going to list other one-liners that I'd also not want, but are less > rare. There are various, but none I'd advocate adding rather than writing > when I need them.___

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
eal-world code (for example, the standard > > library) and pointing out where the proposed new feature would > > demonstrably improve the readability or maintainability of parts of > > the code. > > > We've already had 2 other participants here attesting to frequent use

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
rather than a > > dictionary-like one. > > You keep saying this sort of thing, but you haven't shown us what your > > use-case actually is, and whether it would actually be more > > appropriate for a list instead. > > Do all your tuples have the same length? > &

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
> why haven't you used a list 1. A list is not immutable. 2. I don't want to modify the original sequence. --- Original Message --- On Friday, March 11th, 2022 at 4:07 PM, Marco Sulla wrote: > On Fri, 11 Mar 2022 at 21:39, wfdc via Python-ideas > > python-

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
post your candidate? > > It was you that said it could be a 1-liner. The burden of proof is on you, if > you still want to argue the point. > Rob Cliffe_______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to py

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
olution. There's a reason we have immutable types: To enforce​ immutability. Otherwise, why aren't you proposing getting rid of the tuple type entirely? --- Original Message --- On Friday, March 11th, 2022 at 4:29 PM, David Mertz, Ph.D. wrote: > On Fri, Mar 11, 2022, 4

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
ave immutable types: To enforce​ >> immutability. Otherwise, why aren't you proposing getting rid of the tuple >> type entirely? >> >> --- Original Message --- >> On Friday, March 11th, 2022 at 4:29 PM, David Mertz, Ph.D. >> wrote: >> >>> O

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
mutable types: To enforce​ immutability. > Otherwise, why aren't you proposing getting rid of the tuple type entirely? > > --- Original Message --- > On Friday, March 11th, 2022 at 4:29 PM, David Mertz, Ph.D. > wrote: > >> On Fri, Mar 11, 2022, 4:16 PM wfdc via Pytho

[Python-ideas] Re: Add a replace method to tuples

2022-03-11 Thread wfdc via Python-ideas
: To enforce​ >>> immutability. Otherwise, why aren't you proposing getting rid of the tuple >>> type entirely? >>> >>> --- Original Message --- >>> On Friday, March 11th, 2022 at 4:29 PM, David Mertz, Ph.D. >>> wrote: >&g

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
der than you think. (Try it!) >>>> >>>> How much harder? Can you post your candidate? >>> >>> It was you that said it could be a 1-liner. The burden of proof is on you, >>> if you still want to argue the point. >>> Rob Cliffe__

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
ing at all. It's a perfectly valid question to address to a post that seems to be contesting the purpose of immutable types in the first place. --- Original Message --- On Friday, March 11th, 2022 at 5:38 PM, Rob Cliffe wrote: > This is a common scenario on python-list or pyth

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
nsulting at all. It's a perfectly valid question to address to a >> post that seems to be contesting the purpose of immutable types in the first >> place. > > Gosh, I had no idea immutability could be useful! :-) > > https://openlibra.com/en/book/functional-programming-in-py

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
o-change-values-in-a-tuple > for more context. > > Currently, tuples have 2 public methods: index and count. replace would be > similarly easy to implement and similarly useful. > > Furthermore, it would be a natural counterpart to nametuple's _replace method.

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
2022 at 1:55 AM, Stephen J. Turnbull wrote: > Game theorist here. > > wfdc via Python-ideas writes: > > > Do you see why it's useful to have immutability? > > Sure, it's potentially hashable. But I can't recall ever finding that > > useful in work

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
-in-a-tuple >> for more context. >> >> Currently, tuples have 2 public methods: index and count. replace would be >> similarly easy to implement and similarly useful. >> >> Furthermore, it would be a natural counterpart to nametuple's _replace >> method.__

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
e%5C%28%5Cw%2B%5C%29&patternType=regexp --- Original Message --- On Saturday, March 12th, 2022 at 1:41 AM, Christopher Barker wrote: > Wow! > > Does anyone else see the irony in the fact that just a couple days ago, Chris > A lamented that Python-ideas seemed to > Imm

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
a good use-case for a dataclass. > > > > whether it would actually be more appropriate for a list instead > > > > Lists are not immutable, so they fail the criteria. > > Why? > > Do you see how you are still failing to show any actual code, and thus > > any ac

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
On Monday, March 14th, 2022 at 8:31 AM, Chris Angelico wrote: > On Sat, 12 Mar 2022 at 08:53, wfdc via Python-ideas > > [email protected] wrote: > > > So do you propose getting rid of the tuple type entirely or not? > > > > Do you see why it's usefu

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
them. --- Original Message --- On Monday, March 14th, 2022 at 8:32 AM, Steven D'Aprano wrote: > On Fri, Mar 11, 2022 at 07:12:49PM +, wfdc via Python-ideas wrote: > > > > one Stack Overflow question, with a low number of votes > > > > Mind explain

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
r 11, 2022 at 01:38:57AM +, Rob Cliffe via Python-ideas wrote: > > > This could cause confusion because str.replace() has a completely > > > > different API. > > The old "painter.draw()" versus "gun_slinger.draw()" problem. > > It does exist, b

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
at 8:39 AM, Brendan Barnwell wrote: > On 2022-03-11 12:03, wfdc via Python-ideas wrote: > > > > I've used Python for 23+ years now. I've had occasion where I'd use this > > > methods maybe in the low-tens of times. > > > > > > I'd ca

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
ker [email protected] wrote: > > > Wow! > > > > Does anyone else see the irony in the fact that just a couple days ago, > > Chris A lamented that Python-ideas seemed to > > > > Immediately reject any new idea out of hand? And yes, Chris, you have > >

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
> > up the merge request) ping python-dev directly for a decision. If > > you're worried about coding style or exactly how the submission process > > works, [email protected] will give you help on that with a > > minimum of backseat driving. > > wfdc via

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
They are deliberately > > designed to be drop-in replacements for tuples. > > ChrisA > > _______ > > Python-ideas mailing list -- [email protected] > > To unsubscribe send an email to [email protected] > > https://mail.python.org/mailman3/lists/

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
nt is that they are both sequences and structures. > > https://docs.python.org/3/library/collections.html#collections.namedtuple > > ChrisA > > ___ > > Python-ideas mailing list -- [email protected] > > To

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
's the > > whole point of namedtuple: to avoid doing that. > > The whole point is that they are both sequences and structures. > > https://docs.python.org/3/library/collections.html#collections.namedtuple > > ChrisA > > _______

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
g idea. Perhaps we can discuss it further. > > --- Original Message --- > > On Monday, March 14th, 2022 at 8:38 AM, Steven D'Aprano [email protected] > wrote: > > > On Fri, Mar 11, 2022 at 01:38:57AM +, Rob Cliffe via Python-ideas wrote: > > > &

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
dentifiers. > So again, what are the field names supposed to be if the datastructure is > being treated as a sequence, of possibly arbitrary length? --- Original Message --- On Monday, March 14th, 2022 at 6:19 PM, Greg Ewing wrote: > On 15/03/22 6:14 am, wfdc via Python-id

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
OP sees it as an > > answered question. > > I've been keeping the tone as positive as possible, but honestly, I > > don't think this thread has much hope of being productive at this > > point, and if you hadn't called me out specifically, I would not have >

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
, March 14th, 2022 at 7:04 PM, Chris Angelico wrote: > On Tue, 15 Mar 2022 at 10:02, wfdc via Python-ideas > > [email protected] wrote: > > > See my previous response to Chris: > > > > > What are the named fields supposed to be if the datastructure is being

[Python-ideas] Re: Add a replace method to tuples

2022-03-14 Thread wfdc via Python-ideas
the work, but for those making the proposal. > > If we ask for examples, we expect you to do the work of curating some > > good examples, not just to dump a regex in our laps and tell us to > > search for them ourselves. > > The bottom line here is that we don't have to j

[Python-ideas] Re: Add a replace method to tuples

2022-03-15 Thread wfdc via Python-ideas
> think about 75% of the time "why are they doing this silly approach?" and 25% > "this is easy enough as is." None of them made me think "I wish I had a > method/function."___ Python-ideas mailing list -- pyth

[Python-ideas] New Tool Proposal

2022-05-10 Thread anthony.flury via Python-ideas
FN:Anthony Flury NICKNAME:Tony N:Flury;Anthony;;; TEL;TYPE=home;VALUE=TEXT:01206 391294 TEL;TYPE=cell;VALUE=TEXT:07743282707 UID:c00fc9c3-a56a-4584-8886-6466cf32b9c8 END:VCARD _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email

[Python-ideas] Python array multiplication for negative values should throw an error

2022-05-31 Thread fjwillemsen--- via Python-ideas
. Instead I would propose that array multiplication by negative value throws an error. I would like to hear your opinions on this matter. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected]

[Python-ideas] Re: Python array multiplication for negative values should throw an error

2022-05-31 Thread fjwillemsen--- via Python-ideas
you expect an error but get an empty list, is hard to debug. That is a tradeoff with a clear winner in my opinion. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https

[Python-ideas] Re: Python array multiplication for negative values should throw an error

2022-05-31 Thread fjwillemsen--- via Python-ideas
programmers' part and Python's lack of strict typing. However, raising an error on negative multiplication would immediately make it clear what is wrong, instead of hiding it. _______ Python-ideas mailing list -- [email protected] To unsubscri

[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: 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] 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: 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] 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
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
__. 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-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-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

  1   2   3   4   5   6   7   8   9   10   >