[Python-ideas] commonprefix

2024-06-12 Thread Rob Cliffe via Python-ideas
The os.path.commonprefix function basically returns the common initial characters (if any) shared by a sequence of strings, e.g.     os.path.commonprefix(("Python is great!", "Python is not bad", "Python helps")) # returns "Python " This is purely a str

[Python-ideas] Re: commonprefix

2024-06-17 Thread Rob Cliffe via Python-ideas
The os.path.commonprefix function basically returns the common initial characters (if any) shared by a sequence of strings, e.g.     os.path.commonprefix(("Python is great!", "Python is not bad", "Python helps")) # returns "Python " The following was w

[Python-ideas] Re: commonprefix

2024-06-17 Thread Rob Cliffe via Python-ideas
On 13/06/2024 02:20, Rob Cliffe wrote: The os.path.commonprefix function basically returns the common initial characters (if any) shared by a sequence of strings, e.g.     os.path.commonprefix(("Python is great!", "Python is not bad", "Python helps")) # returns

Re: [Python-ideas] PEP 525: Asynchronous Generators

2016-08-16 Thread Moritz Sichert via Python-ideas
This is a low-level API that coroutines should never > touch. (At least my experience working with coroutines says so...) First of all, thanks for your work in this PEP! I think it really completes the async Python to a state where most synchronous code can be changed easily to be asynchronou

[Python-ideas] Adding optional parameter to shutil.rmtree to not delete root.

2016-08-24 Thread Nick Jacobson via Python-ideas
/questions/185936/delete-folder-contents-in-python But it'd be simpler if there were an optional parameter added to shutil.rmtree, called removeroot. It would default to true so as to not break any backward compatibility. If it's set to false, then it leaves the root directory in

Re: [Python-ideas] Adding optional parameter to shutil.rmtree to not delete root.

2016-08-25 Thread Nick Jacobson via Python-ideas
ing like > shutil.remove_dir_files(). The typical Python term for the concept would be "clear", giving shutil.clear_dir(). Like the ".clear()" method on containers, it would delete the contents, but leave the container itself alone. rmtree() could then be a thin wrapper around clear_dir() that

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Mark Lawrence via Python-ideas
On 29/08/2016 02:44, Ken Kundert wrote: Changing Python so that it understands SI scale factors on real numbers as first class citizens innately requires a change to the base language; it cannot be done solely through libraries. The question before you is, should we do it? No, no, no, if

Re: [Python-ideas] real numbers with SI scale factors

2016-08-29 Thread Mark Lawrence via Python-ideas
On 29/08/2016 13:35, Stephan Houben wrote: Note that the Sage computer algebra system uses Python with some syntactic changes implemented by a "pre-parser". The current proposal could be implemented in a similar way and then integrated in, say, Ipython. If it would prove to be wild

[Python-ideas] Context manager for csv module 'reader' and 'DictReader'?

2021-09-05 Thread C. Titus Brown via Python-ideas
CamelCase used in ‘DictReader’. But maybe that’s just an attempt at foolish consistency :). best, —titus ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3

[Python-ideas] Re: Context manager for csv module 'reader' and 'DictReader'?

2021-09-06 Thread C. Titus Brown via Python-ideas
oking for read or readline instead? Codifying that in some standard way could be nice. best, —titus > On Sep 5, 2021, at 5:30 PM, Oscar Benjamin wrote: > > On Mon, 6 Sept 2021 at 01:13, Greg Ewing wrote: >> >> On 6/09/21 3:07 am, C. Titus Brown via Python-ideas wrote: >>

[Python-ideas] PEP-671 thread - let's take a break, please.

2021-12-09 Thread C. Titus Brown 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

[Python-ideas] 'frozen set' discussion - please consider taking some time off.

2022-01-21 Thread C. Titus Brown via Python-ideas
Hi all, python-ideas moderator here. It’d be great if y’all could take a few days to cool off the frozen set discussion, which is veering off the rails a little bit into emotional language. I’ll keep an eye on it and put emergency moderation into effect if I must, but it’d be nicer if I

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

2019-06-14 Thread Emin Bugra Saral via Python-ideas
gt;> B), then you can say C > A and C > B, but then you can't say A > B or A < B >>> which breaks sorting. >>> >>> If you want to know if a B inherits from Base, then I think `Base in >>> B.mro()` will cover that just as succinctly. And if you need

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

2019-06-18 Thread Emin Bugra Saral via Python-ideas
`<:` kind of notation would look more clear, I agree. My proposition came after thinking the wording used in Python. issubclass() - is subclass? By definition, subclass reminds me set theory. https://en.wikipedia.org/wiki/Subclass_(set_theory) which also has a relativity with Subtyping

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Ben Rudiak-Gould via Python-ideas
On Thu, Mar 12, 2020 at 2:32 PM Marco Sulla via Python-ideas wrote: > > On Thu, 12 Mar 2020 at 21:22, Chris Angelico wrote: > > They actually ARE already discarded > > 0O > You're right. So *how* can juliantaylor said he measured a speedup of > 2x for large ndar

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-04-02 Thread C. Titus Brown via Python-ideas
ng it. Good catch from the end. I found another similar at > https://gstindianews.info. But you get the idea - a simple wrapper around > a list is going to be way better than a wrapper around StringIO. i > > jayesh > _______ > Python

[Python-ideas] MODERATOR - in re "Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments"

2020-06-28 Thread C. Titus Brown via Python-ideas
: The code of conduct that governs this list (and all Python spaces) is here, https://www.python.org/psf/conduct/. If you want to discuss the python code of conduct and its applicability to this thread (or anything else), python-ideas is not the place to do so. You may do so privately with the

[Python-ideas] Re: [Python-Dev] Re: Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments

2020-06-29 Thread C. Titus Brown via Python-ideas
Hi all, as a moderator of python-ideas, I’ve asked postmaster to place python-ideas into emergency moderation. (I do not have the tools to do so myself.) I’m willing to review messages individually as needed. best, —titus > On Jun 29, 2020, at 9:24 AM, Abdur-Rahmaan Janhangeer >

[Python-ideas] Circular Indexing

2020-11-24 Thread Mathew M. Noel via Python-ideas
Python uses an index of -1 to index the last element in a list. Since -1 occurs before 0 we might think of the elements of the linear list are being bent into a circle making the last element occur before the 0th element. Consider a list with n elements: it would be perfectly reasonable to

[Python-ideas] Circular Indexing and FOR loop minimization

2020-11-24 Thread Mathew M. Noel via Python-ideas
As discussed earlier on the post on 'Circular Indexing', considering interpreting indices that lie outside the range 0 to n-1 modulo n for list indexing. Thus element n corresponds to element 0, n+1 to element 1 and so on. This has two consequences: 1.) Makes the Python con

[Python-ideas] Getting rid of FOR loops and simplifying cicular conviolutions with Circular Indexing

2020-11-25 Thread Mathew M. Noel via Python-ideas
extremely common in ML. Using circular indexing gets rid of this extra FOR loop. If we have to iterate 2 times you can iterate using range(-n,n) but in most cases you need to iterate over 10 or more epochs in ML. Most scientific applications of Python involve an outer FOR loop which

[Python-ideas] Re: Getting rid of FOR loops and simplifying cicular conviolutions with Circular Indexing

2020-11-25 Thread Mathew M. Noel via Python-ideas
: [email protected]; [email protected] Subject: Re: [Python-ideas] Getting rid of FOR loops and simplifying cicular conviolutions with Circular Indexing days_of_the_week[14 % 7] There ya go! On Wed, Nov 25, 2020 at 12:51 PM Mathew M. Noel via Python-ideas mailto:[email protected]

[Python-ideas] Re: Getting rid of FOR loops and simplifying cicular convolutions with Circular Indexing

2020-11-26 Thread Mathew M. Noel via Python-ideas
: Mathew M. Noel Cc: python-ideas; [email protected] Subject: Re: [Python-ideas] Getting rid of FOR loops and simplifying cicular conviolutions with Circular Indexing You've started three separate threads to propose something that has exactly zero chance of happening, and would be of

Re: [Python-ideas] PEP 562

2017-09-12 Thread Ionel Cristian Mărieș via Python-ideas
The PEP should > appear online soon. > > -- > Ivan > > *** > > PEP: 562 > Title: Module __getattr__ > Author: Ivan Levkivskyi > Status: Draft > Type: Standards Track > Content-Type: text/x-rst &g

Re: [Python-ideas] PEP 562

2017-09-12 Thread Ionel Cristian Mărieș via Python-ideas
s ain't a walk in a park, and there's the boilerplate and the crazy issues with interpreter shutdown. -- Thanks, -- Ionel Cristian Mărieș, http://blog.ionelmc.ro _______ Python-ideas mailing list [email protected] https://mail.python.org/mai

[Python-ideas] __intancehook__ special method

2017-12-26 Thread Yahya Abou 'Imran via Python-ideas
PositiveInteger(metaclass=MyMeta): @classmethod def __instancehook__(cls, instance): return isinstance(instance, int) and instance > 0 Of course, the real implemention is more detailed... What do you think about that ?___ Python-id

Re: [Python-ideas] __intancehook__ special method

2017-12-26 Thread Yahya Abou 'Imran via Python-ideas
y. Maybe I can make this compatible with it anyway._______ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] Make MappingView inherit from Collection instead of Sized

2017-12-29 Thread Yahya Abou 'Imran via Python-ideas
After I generate an UML diagram from collections.abc, I found very strange that MappingView inherit from Sized instead of Collection (new in python 3.6). Yes, MappingView only define __len__ and not __iter__ and __contains__, but all of its subclasses define them (KeysView, ValuesView and

[Python-ideas] Change the __repr__ of the `MappingView`s

2017-12-30 Thread Yahya Abou 'Imran via Python-ideas
;/usr/lib/python3.6/_collections_abc.py", line 764, in __iter__ yield self._mapping[key] TypeError: list indices must be integers or slices, not str It's because __init__ in MappingView treat the passed argument -- wich is stored in self._mapping -- as the whole mapping, not jus

Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation

2017-12-30 Thread Yahya Abou 'Imran via Python-ideas
a way to hide the paranetesis either. I could make those changes whth a graphic tool though. Same thing with the empty box. Whereas it's possible with plantuml. But may be I have to use a pure python tool. What's your opinions about that? Another thing: for exemple, in the case o

Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation

2017-12-30 Thread Yahya Abou 'Imran via Python-ideas
Mixin Methods. _______ 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] Add an UML class diagram to the collections.abc module documentation

2017-12-30 Thread Yahya Abou 'Imran via Python-ideas
c.png]___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] Improve ABCs _dump_registry() readability

2017-12-30 Thread Yahya Abou 'Imran via Python-ideas
In python 2.7, ABCs's caches and registries are sets. But in python 3.6 they are WeakSet. In consequence, the output of _dump_registry() is almost useless: >>> from collections import abc >>> abc.Iterator._dump_registry() Class: collections.abc.Iterator Inv

Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation

2017-12-31 Thread Yahya Abou 'Imran via Python-ideas
In the table of the documentation page, the abstract methods are listed fisrt. In the source code, the abstract methods are implemented fisrt. In UML, the convention is to place the abstract methods first. _______ Python-ideas mailing list Python-ideas@python.

Re: [Python-ideas] Improve ABCs _dump_registry() readability

2017-12-31 Thread Yahya Abou 'Imran via Python-ideas
unter: 8 _abc_cache: {} _abc_negative_cache: set() _abc_negative_cache_version: 8 _abc_registry: set() It's going into the cache and not into the registry. Strange behaviour... >I guess a PR to fix the registry output would make sense (first file a bug on >bugs.python.org for it). Ok, I wi

Re: [Python-ideas] Improve ABCs _dump_registry() readability

2017-12-31 Thread Yahya Abou 'Imran via Python-ideas
's empty: every iterator passed to Iterator.register() defines __iter__ and __next__, so they satisfy Iterator.__subclasshook__ and are added to the cache beforehand. ___ 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] Add an UML class diagram to the collections.abc module documentation

2018-01-01 Thread Yahya Abou 'Imran via Python-ideas
ragmatic Programmer, Andrew Hunt & David Thomas. Here are the files! I used plantuml. base.puml Description: Binary data full.puml Description: Binary data other_collections.puml Description: Binary data ___ Python-ideas mailing list Python-ideas

Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation

2018-01-01 Thread Yahya Abou 'Imran via Python-ideas
also interesting by the way...___ 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] Add an UML class diagram to the collections.abc module documentation

2018-01-01 Thread Yahya Abou 'Imran via Python-ideas
nsome going forward or we will simply have to >> drop the image at the first instance of needing to update it because no one >> can or be willing to put in the effort (and I'm thinking in 5 years, not >> soon while we can count on you to help). >> >> On Sat, Dec

Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation

2018-01-02 Thread Yahya Abou 'Imran via Python-ideas
ections-abc-uml/blob/master/plantuml/other_collections.svg https://gitlab.com/yahya-abou-imran/collections-abc-uml/blob/master/plantuml/full.svg___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas

Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation

2018-01-02 Thread Yahya Abou 'Imran via Python-ideas
hat it's a lot more work (and pain) than a plain text file. ___ 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] Add an UML class diagram to the collections.abc module documentation

2018-01-02 Thread Yahya Abou 'Imran via Python-ideas
rite to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. . The full text of the GPL is distributed in /usr/share/common-licenses/GPL-3 on Debian systems. ___ Python-ideas mailing list Python-ideas@py

Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation

2018-01-02 Thread Yahya Abou 'Imran via Python-ideas
And on the sourceforge page: https://sourceforge.net/projects/plantuml/ License GNU General Public License version 2.0 (GPLv2) ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct

Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation

2018-01-05 Thread Yahya Abou 'Imran via Python-ideas
don't manage to all agree with each other, I will just let the issue open until somebody comes with an undisputed solution._______ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Condu

[Python-ideas] __vars__ special method

2018-01-22 Thread Yahya Abou 'Imran via Python-ideas
attr, value in self.__dict__.items() if not attr.startswith('_')} _______ 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] __vars__ special method

2018-01-25 Thread Yahya Abou 'Imran via Python-ideas
amespace you want to expose to your clients without compromosing the real one. Of course, the real one could always be accessible via __dict__ (if present). ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] List the methods of a metaclass in the help of its instances

2018-02-11 Thread Yahya Abou 'Imran via Python-ideas
apply of course.___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] Re: Addition to fnmatch.py

2022-06-05 Thread Eric V. Smith via Python-ideas
gt;> s = set([10, 20, 1]) >>> s {1, 10, 20} You're seeing an accidental byproduct of the implementation. Eric _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] ht

[Python-ideas] Re: default as a keyword argument for dict.get and dict.pop

2022-06-08 Thread Eric V. Smith via Python-ideas
a performance issue with keyword arguments vs. positional. People are touchy when it comes to dicts! Eric _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.

[Python-ideas] Re: PEP 671 (late-bound arg defaults), next round of discussion!

2022-06-17 Thread Eric V. Smith via Python-ideas
permitted, and then a future version of Python changes it to be an exception? Or the other way around? Because I could do that. Maybe it would reduce the arguments. Pun intended, and I am not apologizing for it. A third option would be that it's a syntax error for you to define such a fun

[Python-ideas] Re: Add a line_offsets() method to str

2022-06-18 Thread Eric V. Smith via Python-ideas
On 6/18/2022 5:34 PM, Paul Moore wrote: After all, it has the advantage of working on older versions of Python (and given that one of your use cases is Textual, I can't imagine anyone would be happy if that required Python 2.12+...) Guido's "no 2.8" shirt apparently did

[Python-ideas] Re: Generalized deferred computation in Python

2022-06-22 Thread Eric V. Smith via Python-ideas
ork with the expression AST *before* evaluation). My > concern is that we're unlikely to be able to justify *two* forms of > "deferred expression" construct in Python, and your proposal, by > requiring transparent evaluation on reference, would preclude any > processing (suc

[Python-ideas] Re: Void type

2022-07-27 Thread Eric V. Smith via Python-ideas
e". I'd rather look into > ways of solving that problem instead - ways of taking a function > signature, making specific changes to it (usually adding and/or > removing args, but maybe other changes), and then making that your > declared signature. At the moment, it's only po

[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] 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: Idea: Tagged strings in python

2022-12-17 Thread Eric V. Smith via Python-ideas
everyone! > > I'm the maintainer of a small django library called django-components. I've > run into a problem that I have a language-level solution (tagged strings) to, > that I think would benefit the wider python community. > > *Problem* > A component in my libra

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

2022-12-22 Thread Eric V. Smith via Python-ideas
t;) and then proceeds to cast the pointer and directly inspect its members. As such, I don't think UserString can ever truly be a str, I had figured subclasses of str wouldn’t be full players in the C code — but join() us pretty fundamental:-(

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

2023-02-16 Thread Eric V. Smith via Python-ideas
tutorial on the distinction between bytes and strings > and why it is important, when I saw the root cause. People coming from > C, Perl, Python 2 and similar languages tend to misinterpret "\x90" for > b"\x90" often. My idea is that Python could deprecate string literals >

[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: [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: Extract variable name from itself

2023-09-23 Thread Eric V. Smith via Python-ideas
On Sep 23, 2023, at 5:37 PM, Dom Grigonis wrote:It seems that my guess was correct. There was a commit, when only the first part was working:https://github.com/python/cpython/pull/13123/commits/67977672360659f203664d23cfc52b5e07e4381aSince I wrote that commit: no one is saying it’s impossible

[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: 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

Re: [Python-ideas] Syntactic sugar to declare partial functions

2018-08-14 Thread Chris Barker - NOAA Federal via Python-ideas
htening. -CHB _______ 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] Python docs: page: In what ways in None special

2018-08-15 Thread Chris Barker - NOAA Federal via Python-ideas
> None is keyword, and just like any other keyword, it can't be re-bound. >> it's only a keyword because Python doesn't otherwise have a way of creating >> non-rebindable names. It's purpose is to represent the singular object of >> NoneType, and in t

Re: [Python-ideas] Jump to function as an an alternative to call function

2018-08-17 Thread Chris Barker - NOAA Federal via Python-ideas
espace — you can mess with pretty much anything else in Python. -CHB Sent from my iPhone On Aug 17, 2018, at 12:46 PM, Chris Barker wrote: On Thu, Aug 16, 2018 at 12:37 PM, Chris Angelico wrote: > > I've no idea what interpreter you're using, but it doesn't work for

Re: [Python-ideas] A GUI for beginners and experts alike

2018-08-24 Thread Chris Barker - NOAA Federal via Python-ideas
look at traitsui for ideas. http://docs.enthought.com/traitsui/ -CHB ___ 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 GUI for beginners and experts alike

2018-08-24 Thread Chris Barker - NOAA Federal via Python-ideas
to provide exactly one high-quality > implementation for each platform, with as few layers as > practicable between the Python API and the platform's native > GUI facilities. So kinda like wxWidgets but in Python — which would be nice. wxPython definitely suffers from its C++ underpi

Re: [Python-ideas] support toml for pyproject support

2018-10-09 Thread Chris Barker - NOAA Federal via Python-ideas
ood choice! We’re have enough trouble with really slow adoption of the new ways of doing packaging, not even providing the tools seems to really defeat the purpose. -CHB ___ Python-ideas mailing list [email protected] https://mail.python.org/mail

Re: [Python-ideas] Revisiting Immutable Mappings

2018-10-11 Thread Chris Barker - NOAA Federal via Python-ideas
CHB ___ 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] Relative Imports

2018-11-13 Thread Chris Barker - NOAA Federal via Python-ideas
t; > from . import test_main > > to get the test/test_main module from the test/__init__ module. > > (Disclaimer: I have not actually run the above code to check that it > works, beyond testing that its not a SyntaxError.) > > What *precisely* is the problem you are tryi

Re: [Python-ideas] Suggested MapView object (Re: __len__() for map())

2018-12-11 Thread Chris Barker - NOAA Federal via Python-ideas
Perhaps I got confused by the early part of this discussion. My point was that there is no “map-like” object at the Python level. (That is no Map abc). Py2’s map produced a sequence. Py3’s map produced an iterable. So any API that was expecting a sequence could accept the result of a py2 map

Re: [Python-ideas] Suggested MapView object (Re: __len__() for map())

2018-12-12 Thread Chris Barker - NOAA Federal via Python-ideas
sure why one would do that, but it should be possible. - CHB ___ 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] Add list.join() please

2019-01-29 Thread Chris Barker - NOAA Federal via Python-ideas
> Alex Shafer via Python-ideas wrote: >> 1) I'm in favor of adding a stringify method to all collections > > Are you volunteering to update all the collection > classes in the world written in Python? :-) To be fair, we could add an implementation to the sequence ABC, a

Re: [Python-ideas] Attribute-Getter Syntax Proposal

2019-03-08 Thread Chris Barker - NOAA Federal via Python-ideas
> > Rather than using map in this way, I would recommend a list comprehension: Exactly! I really don’t get why folks want to use map() so much when the comprehension syntax is often cleaner and easier. It was added for a reason :-) -CHB ___

[Python-ideas] Asyncio Future.set_result_threadsafe

2020-02-12 Thread Brian Allen Vanderburg II via Python-ideas
, a method like future.set_result_threadsafe, which would hide the details of the loop.call_soon/call_soon_threadsafe ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.pyth

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

2020-10-13 Thread Brian Allen Vanderburg II via Python-ideas
te": > >     class MySpecialException(Exception): >         pass > > > I think that in 22 years of using Python, I have never written an > exception that took more than these two lines of code. > > Heck, I even have my memory jogged of string exceptions reading this.  &

[Python-ideas] TextIOWrapper support for null-terminated lines

2020-10-24 Thread Brian Allen Vanderburg II via Python-ideas
I have a use case where I'm writing a small filter in Python which should be able to take output from the find command to filter and optionally pass it to other commands (like xargs), but also can be passed specific filenames for the input and/or output.  Find can output it's filenam

[Python-ideas] Conditional function/method/dict arguments assignments

2020-10-24 Thread Brian Allen Vanderburg II via Python-ideas
s not None:     data["count"] = count Could be written as data = {     "count" = count is not None ?? count, # set the "count" key in the dictionary conditionally, if count is not None, else don't set the key at all     "other_param" = ... ?? ...,     ... }

Re: [Python-ideas] High Precision datetime

2018-05-14 Thread Chris Barker - NOAA Federal via Python-ideas
oesn’t seem like a good idea to be handling months and femptoseconds with the same “encoding” -CHB ___ 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] String and bytes bitwise operations

2018-05-18 Thread Chris Barker - NOAA Federal via Python-ideas
from 0 to 255, as opposed to being > the number itself, but that's getting rather existential :) No, I’m making the distinction that an eight bit byte is, well, eight bits, that CAN represent a number from 0 to 255, or it can represent any other data type — like one eighth of the bits in a

Re: [Python-ideas] Add dict.append and dict.extend

2018-06-04 Thread Chris Barker - NOAA Federal via Python-ideas
ood solution. I know I spent years thinking “there should be an easy way to do this” before I found setdefault(). -CHB > > :-) > > [snip] > ___ > Python-ideas mailing list > [email protected] > https://mail.python.org/mailman/list

Re: [Python-ideas] Making Path() a built in.

2018-06-05 Thread Chris Barker - NOAA Federal via Python-ideas
that gets tacked on automatically in you app, so again, you use relative paths everywhere. The concept of non-python-code resources being accessible within a package is really a separate issue than generic data files, etc. that you may want to access and serve different way. In short, if you have a

Re: [Python-ideas] Making Path() a built in.

2018-06-06 Thread Chris Barker - NOAA Federal via Python-ideas
? I know it's not exactly properties on a class, > but I thought there were other cases, even if I couldn't name one. > Dont mind me, then. It wouldn’t be THAT hard to wrote lazy-import code for pathlib. But there has been a lot of discussion lately about Python startup time

[Python-ideas] Python Decorator Improvement Idea

2018-06-15 Thread Brian Allen Vanderburg II via Python-ideas
Just a small idea that could possibly be useful for python decorators. An idea I had is that it could be possible for a decorator function to declare a parameter which, when the function is called as a decorator, the runtime can fill in various information in the parameters for the decorator to

Re: [Python-ideas] Python Decorator Improvement Idea

2018-06-16 Thread Brian Allen Vanderburg II via Python-ideas
ed inside the body of a class to decorate a class member:     class MyClass(object):         @decorator         def method(self):             pass Using the explicit is better than implicit:     class MyClass(object):         @decorator(MyClass, ...)         def method(self):             pass

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

2018-06-23 Thread Chris Barker - NOAA Federal via Python-ideas
>> However -- if this is really such a good idea -- wouldn't someone have make >> a C lib that does it? Or has someone? Anyone looked? > > No, there's nothing magical about C. You can do it in pure Python. Sure, but there are a number of FP subtleties around the

Re: [Python-ideas] "Exposing" `__min__` and `__max__`

2018-06-27 Thread Chris Barker - NOAA Federal via Python-ideas
. -CHB ___ 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] Add a __cite__ method for scientific packages

2018-06-28 Thread Chris Barker - NOAA Federal via Python-ideas
___ 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] Allow a group by operation for dict comprehension

2018-06-28 Thread Chris Barker - NOAA Federal via Python-ideas
sion that transforms the list first. That would get the keys right. Though still not call append for you. So maybe a solution is an accumulator special case of defaultdict — it uses a list be default and appends by default. Almost like counter... -CHB _______ Pyt

Re: [Python-ideas] Allow a group by operation for dict comprehension

2018-06-28 Thread Chris Barker - NOAA Federal via Python-ideas
l is. Which makes me think — a new classmethod on the builtin dict is a pretty heavy lift compared to a new type of dict in the collections module. -CHB _______ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-

Re: [Python-ideas] Where should grouping() live (was: grouping / dict of lists)

2018-07-06 Thread Chris Barker - NOAA Federal via Python-ideas
ilt a histogram for continuous data as well. Though that might be a bit klunky. But if someone thinks that’s a good idea, a PR for an example would be accepted: https://github.com/PythonCHB/grouper -CHB -- Steve ___ Python-ideas mailing list Python-

Re: [Python-ideas] if we were to ever shorten `A if A else B` (was: PEP 505: None-aware operators)

2018-07-21 Thread Chris Barker - NOAA Federal via Python-ideas
> my vote would go to `A otherwise B` since it's unambiguous, the case you care > about the state of comes first, and it doesn't trip your brain up looking > for 'if'. :) And I’d hope “otherwise” is a rare variable name :-) - CHB > > _____

Re: [Python-ideas] Multi-core reference count garbage collection

2018-07-21 Thread Chris Barker - NOAA Federal via Python-ideas
de, and run a garbage collector once in a while instead. After all, cPython’s (mostly) deterministic garbage collection is not guaranteed by the language standard. -CHB _______ Python-ideas mailing list [email protected] https://mail.python.org/mailma

Re: [Python-ideas] Performance improvements via static typing

2018-07-21 Thread Chris Barker - NOAA Federal via Python-ideas
A note here: Earlier in the conversation about standardizing type hinting, I (among others) was interested in applying it to C-level static typing (e.g. Cython). Guido made it very clear that that was NOT a goal of type hints — rather, they were to be used for dynamic, python style types — so a

Re: [Python-ideas] Revisiting str.rreplace()

2018-07-21 Thread Chris Barker - NOAA Federal via Python-ideas
t; something which could much more easily be done by adding an rreplace > function - which is the real point of the comment. > Paul > ___ > Python-ideas mailing list > [email protected] > https://mail.python.org/mailman/listinfo/

Re: [Python-ideas] Python docs page: In what ways is None special

2018-07-23 Thread Chris Barker - NOAA Federal via Python-ideas
lp the authors of suck a package(s), but if the bulk of users didn’t need them, then no point in adding them to the language. -CHB _______ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of

Re: [Python-ideas] Python docs page: In what ways is None special

2018-07-23 Thread Chris Barker - NOAA Federal via Python-ideas
; --- This is also a convention — and primarily applies to mutable defaults, which you hardly ever want to assign directly. So a good example of None being used as a sentinel, but nog really anything special about None. -CHB > / ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

<    12   13   14   15   16   17