[Python-Dev] Re: Should the definition of an "(async) iterator" include __iter__?

2021-09-15 Thread Chris Barker via Python-Dev
Note: I am all for not enforcing anything here -- let's keep duck typing alive! If static type checkers want to be more pedantic, they can be -- that's kinda what they are for :-) But the OP wrote: """ "[i]terators are required to have an __iter__()

[Python-Dev] Re: Advantages of pattern matching - a simple comparative analysis

2021-01-18 Thread Chris Barker via Python-Dev
On Mon, Nov 23, 2020 at 8:20 AM Brian Coleman wrote: > Take as an example a function designed to process a tree of nodes similar > to that which might be output by a JSON parser. There are 4 types of node: > > - A node representing JSON strings > - A node representing JSON numbers > - A node

[Python-Dev] Re: Unification of the Mac builds?

2021-01-18 Thread Chris Barker via Python-Dev
Thanks Ronald, This is really helpful. -CHB On Fri, Jan 15, 2021 at 5:43 AM Ronald Oussoren wrote: > > > On 14 Jan 2021, at 23:03, Chris Barker via Python-Dev < > python-dev@python.org> wrote: > > Ned, > > Thanks -- I'll take further discussion to the python-ma

[Python-Dev] Re: Unification of the Mac builds?

2021-01-14 Thread Chris Barker via Python-Dev
Ned, Thanks -- I'll take further discussion to the python-mac list. Ronald: That’s a feature of the framework build. The unix build is exactly the same > as a unix build on other platform. Adding the same feature to the unix > build should be possible, but would complicate the build. I have

[Python-Dev] Re: Story behind vars() vs .__dict__

2021-01-08 Thread Chris Barker via Python-Dev
This was discussed a bit over on python-ideas recently, so a note from me, and one from that thread: Or for that matter, not the reason to provide > object's internal storage via object's attribute: obj.__dict__. > Well, it IS an implementation detail that it's a dictionary, but having a dunder

[Python-Dev] Re: unittest of sequence equality

2021-01-08 Thread Chris Barker via Python-Dev
On Wed, Dec 23, 2020 at 1:06 AM Steven D'Aprano wrote: > We're not obligated to take heroic > measures to integrate numpy arrays with unittest methods. If we can do > so easily, sure, let's fix it. > > I think Ivan's suggestion that the assertSequenceEqual method fall back > on

[Python-Dev] Unification of the Mac builds?

2021-01-08 Thread Chris Barker via Python-Dev
Sorry if I'm out of the loop here, but with Apple's new chip coming out, we need new a build configuration (which I think has already been started, if not done). Perhaps we could take this opportunity to better modularize / unify the build setup? As it was last I checked, you really had only two

[Python-Dev] Re: PEP 611: The one million limit.

2019-12-13 Thread Chris Barker via Python-Dev
I am not qualified to comment on much of this, but one simple one: 1 million is a nice round easy to remember number. But you can fit 2 million into 21 bits, and still fit three into 64 bits, so why not? Ialso noticed this: > Reference Implementation > > None, as yet.

[Python-Dev] Re: The Python 2 death march

2019-09-18 Thread Chris Barker via Python-Dev
On Tue, Sep 17, 2019 at 10:39 PM Terry Reedy wrote: > I agree. The thread title is a bit extreme. There will be a long > twilight. > > > Metaphorically that is correct, but at the same time there are > > things like https://pythonclock.org which > > is one

[Python-Dev] Re: The Python 2 death march

2019-09-17 Thread Chris Barker via Python-Dev
Peter, I think that went just to me, which I suspect was not what you intended, so I've brought it back on the list: On Tue, Sep 17, 2019 at 12:06 PM Peter Wang wrote: > On Mon, Sep 16, 2019 at 5:55 PM Chris Barker via Python-Dev < > python-dev@python.org> wrote: > >> R

[Python-Dev] Re: The Python 2 death march

2019-09-16 Thread Chris Barker via Python-Dev
Regardless of the date of the final release, no one's Python2 install will stop working, and people will still be able to download and install that last release. So I like the metaphor -- it's being "sunset" -- there will be a long dusk .. a month or tow makes no difference to anyone's

[Python-Dev] Re: Building Standalone Python Applications with PyOxidizer

2019-07-01 Thread Chris Barker via Python-Dev
Congrats on this new tool -- I'll be checking it out. With a quick glance at the docs, I see this: """ PyOxidizer loads everything from memory and there is no explicit I/O being performed. When you import a Python module, the bytecode for that module is being loaded from a memory address in the

[Python-Dev] Re: strip behavior provides inconsistent results with certain strings

2019-07-01 Thread Chris Barker via Python-Dev
This was quite extensively discussed on python-ideas recently: https://mail.python.org/archives/list/python-id...@python.org/thread/RJARZSUKCXRJIP42Z2YBBAEN5XA7KEC3/#WIRID57ESUFUAQQQ6ZUY2RK5PKQQYSJ3 (I'm finding it hard to find a good thread view in the new interface -- but that will get you

Re: [Python-Dev] Consolidating channel of record [was: 581 (Using GitHub issues for CPython) is accepted]

2019-05-15 Thread Chris Barker - NOAA Federal via Python-Dev
Frankly, multiple long meandering threads in s single mailing list are not s very good archive either. Ideally, the PEP is updated with a summary of the issues discussed as the discussion unfolds. (And links to the main discussion threads?) It founds like that didn’t happen in this case, but

Re: [Python-Dev] Proposal: dict.with_values(iterable)

2019-04-22 Thread Chris Barker via Python-Dev
On Fri, Apr 12, 2019 at 10:20 AM Brett Cannon wrote: > >> This doesn't strike me as needing an optimization through a dedicated > method. > maybe a new dict mapping type -- "shared_dict" -- it would be used in places like the csv reader where it makes sense, but wouldn't impact the regular dict

Re: [Python-Dev] PEP-582 and multiple Python installations

2019-04-04 Thread Chris Barker via Python-Dev
Sorry somehow missed Steve Dower's post: that discussion is mostly happening at https://discuss.python.org/t/pep-582-python-local-packages-directory/963/ I"ll go there to comment. -CHB On Thu, Apr 4, 2019 at 9:02 AM Chris Barker - NOAA Federal < chris.bar...@noaa.gov> wrote: >

Re: [Python-Dev] PEP-582 and multiple Python installations

2019-04-04 Thread Chris Barker - NOAA Federal via Python-Dev
> I'd like to raise a potential edge case that might be a problem, and likely > an increasingly common one: users with multiple installations of the *same* > version of Python. I would suggest that that use case is best addressed by a system that isolates the entire python environment, such as

Re: [Python-Dev] datetime.timedelta total_microseconds

2019-02-27 Thread Chris Barker via Python-Dev
On Wed, Feb 27, 2019 at 3:04 PM Richard Belleville wrote: > Timedelta division is quite a nice solution to the problem. However, since > we're maintaining a python version agnostic library at least until 2020, we > need a solution that works in python 2 as well. > So you were limited to a py2

Re: [Python-Dev] datetime.timedelta total_microseconds

2019-02-27 Thread Chris Barker via Python-Dev
Did we ever hear back from the OP as to whether they were using py2 or 3? If they were unable to find timedelta division in py3 -- that's a pretty good case that we need something else. The OP: """ On Wed, Feb 13, 2019 at 9:10 PM Richard Belleville via Python-Dev < python-dev@python.org> wrote:

Re: [Python-Dev] datetime.timedelta total_microseconds

2019-02-27 Thread Chris Barker via Python-Dev
On Wed, Feb 27, 2019 at 7:15 AM Paul Ganssle wrote: > As another data point, I also have a background in the physical sciences, > and I actually do find it quite intuitive. The first time I saw this idiom > I took it to heart immediately and only stopped using it because many of > the libraries

Re: [Python-Dev] datetime.timedelta total_microseconds

2019-02-27 Thread Chris Barker via Python-Dev
On Tue, Feb 26, 2019 at 7:22 PM Terry Reedy wrote: > > timedelta.total_seconds() > > To me, total_x implies that there is a summation of multiple timedeltas, > and there is not. So not intuitive to me. THAT was a discussion for when it was added -- I can't say it's my favorite name either.

Re: [Python-Dev] Compact ordered set

2019-02-27 Thread Chris Barker via Python-Dev
On Tue, Feb 26, 2019 at 3:43 PM Barry Warsaw wrote: > The behavior differences between dicts and sets is already surprising to > many users, so we should be careful not to make the situation worse. > It's a nice to have, but other than the fact that we all used to use a dict when we really

Re: [Python-Dev] Another update for PEP 394 -- The "python" Command on Unix-Like Systems

2019-02-26 Thread Chris Barker via Python-Dev
On Tue, Feb 26, 2019 at 3:25 PM Barry Warsaw wrote: > > Who gets to decide on PEP 394 changes? > > Honestly, I think it’s the active distro maintainers who need to make this > decision. They have the pulse of their own communities and users, and can > make the best decisions and compromises for

Re: [Python-Dev] datetime.timedelta total_microseconds

2019-02-26 Thread Chris Barker via Python-Dev
This thread petered out, seemingly with a consensus that we should update the docs -- is anyone doing that? But anyway, I'd like to offer a counterpoint: >From the OP, it is clear that: * Folks have a need for timedeltas to be converted to numbers values, with units other than seconds

Re: [Python-Dev] Another update for PEP 394 -- The "python" Command on Unix-Like Systems

2019-02-26 Thread Chris Barker via Python-Dev
On Tue, Feb 26, 2019 at 9:58 AM Barry Warsaw wrote: > I see this question as having several parts, and the conflation of them is > part of the reason why the unversioned `python` command is so problematic. > Python is used for: > > * OS functionality > * to run applications that aren’t critical

Re: [Python-Dev] Another update for PEP 394 -- The "python" Command on Unix-Like Systems

2019-02-15 Thread Chris Barker via Python-Dev
On Fri, Feb 15, 2019 at 2:39 PM Brett Cannon wrote: > In my experience after using 'py' on Windows I consistently miss it on > UNIX now, so to me there is enough of a benefit that I will continue to > chip away at the project until it's done regardless of whether anyone else > uses it. :) > And

Re: [Python-Dev] datetime.timedelta total_microseconds

2019-02-15 Thread Chris Barker via Python-Dev
On Fri, Feb 15, 2019 at 11:58 AM Rob Cliffe via Python-Dev < python-dev@python.org> wrote: > A function with "microseconds" in the name IMO misleadingly suggests that > it has something closer to microsecond accuracy than a 1-second granularity. > it sure does, but `delta.total_seconds()` is a

Re: [Python-Dev] Another update for PEP 394 -- The "python" Command on Unix-Like Systems

2019-02-13 Thread Chris Barker via Python-Dev
On Wed, Feb 13, 2019 at 12:29 PM Barry Warsaw wrote: > I think we should aspire for this to be the case too, eventually. When > this has come up in the past, we’ve said that it’s not appropriate to > change PEP 394 until Python 2 is officially deprecated. OTOH, I appreciate > that distros and

Re: [Python-Dev] Another update for PEP 394 -- The "python" Command on Unix-Like Systems

2019-02-13 Thread Chris Barker - NOAA Federal via Python-Dev
> On Feb 13, 2019, at 9:13 AM, Steve Dower > > I'm inclined to view "python" as the default, official command, with the > versioned ones being workarounds added by distributors. +1 — almost. I agree that “python” be the default, but it would be good to require (or at least highly encourage)

Re: [Python-Dev] Add more SyntaxWarnings?

2019-01-28 Thread Chris Barker - NOAA Federal via Python-Dev
> But as a rule, >> there are a LOT of errors that can be pretty mysterious to newbies. > > Isn't that the very definition of "newbie"? That's half a joke, but I > really don't think that programmers new to Python should be the > standard. Python is broadly advocated (and used) as a first

Re: [Python-Dev] Add more SyntaxWarnings?

2019-01-24 Thread Chris Barker - NOAA Federal via Python-Dev
>. There's nothing mysterious about e.g. `TypeError: unsupported operand type(s) for +: 'int' and 'str'`, unlike the case of the two concatenated tuples. (Surely people get errors about int+str all the time, and they've never complained -- unlike the tuple tuple case.) Well, yes, that particular

Re: [Python-Dev] Sub-interpreters: importing numpy causes hang

2019-01-24 Thread Chris Barker - NOAA Federal via Python-Dev
If your primary concern is module clashes between plugins, maybe you can hack around that: 1) if the plugins are providing copies of any other modules, then you can simply require them to put them in their own namespace — that is, a plug-in is a single package, with however many sub modules as it

Re: [Python-Dev] 3.7.2rc1 and 3.6.8rc1 cutoffs ahead, last 3.6.x bugfix release!

2018-12-19 Thread Chris Barker - NOAA Federal via Python-Dev
I’m all for extending the life of 3.6, it sure feels recent to me! > 3.6 is the default Python in Ubuntu 18.04 LTS and RHEL 8. And due to several > important syntax features it can be a minimal required version for long time. Which is a good argument for why we may not need longer term support

Re: [Python-Dev] Need discussion for a PR about memory and objects

2018-11-19 Thread Chris Barker via Python-Dev
On Mon, Nov 19, 2018 at 1:41 AM Antoine Pitrou wrote: > I'd rather keep the reference to memory addressing than start doing car > analogies in the reference documentation. > I agree -- and any of the car analogies will probably be only valid in some jurisdictions, anyway. I think being a bit

Re: [Python-Dev] Signalling NANs

2018-11-09 Thread Chris Barker via Python-Dev
001' >> > > I got '0x7ff1'. > > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-de

Re: [Python-Dev] "Deprecation" of os.system in favor of subprocess?

2018-10-24 Thread Chris Barker via Python-Dev
On Wed, Oct 24, 2018 at 9:06 AM, Victor Stinner wrote: > I like os.system() and use it everyday. me too. Python has been evolved over the years away from a "scripting language", and becoming more of a "systems language". Which is mostly a good thing, but no need to gratuitously make quick

Re: [Python-Dev] Arbitrary non-identifier string keys when using **kwargs

2018-10-11 Thread Chris Barker - NOAA Federal via Python-Dev
> On the server side, the application could be doing something like > assuming that the kwargs are e.g. column names This is exactly a use-case for non-identifier strings in kwargs. The rules for valid field names could very well be different than Python’s rules. The kwargs implementation is not

Re: [Python-Dev] Arbitrary non-identifier string keys when using **kwargs

2018-10-07 Thread Chris Barker via Python-Dev
t may or may not apply to everywhere nameapaces are used in the interpreter... > but __dict__ is described as " [a] dictionary or other mapping object". > exactly. -CHB On Sun, 7 Oct 2018 at 19:38, Chris Barker via Python-Dev < > python-dev@python.org> wrote: > >> On Fri

Re: [Python-Dev] Arbitrary non-identifier string keys when using **kwargs

2018-10-07 Thread Chris Barker via Python-Dev
On Fri, Oct 5, 2018 at 3:01 PM Brett Cannon wrote: > I'm also fine with saying that keys in **kwargs that are not proper > identifiers is an implementation detail. > It's not just **kwargs -- you can also use arbitrary names with setattr() / getattr() : In [6]: setattr(foo, "4 not an

Re: [Python-Dev] Official citation for Python

2018-09-15 Thread Chris Barker via Python-Dev
> > On Saturday, September 15, 2018, Jacqueline Kazil > wrote: > >> I just got caught up on the thread. This is a really great discussion. >> Thank you for all the contributions. >> >> Before we get into the details, let's go back to the main use case we are >> trying to solve. >> *As a user, I

Re: [Python-Dev] Official citation for Python

2018-09-11 Thread Chris Barker via Python-Dev
Thanks Wes. """ > Python > > Guido van Rossum: Scripting the Web with Python. In "Scripting Languages: > Automating the Web", World Wide Web Journal, Volume 2, Issue 2, Spring > 1997, O'Reilly. > > Aaron Watters, Guido van Rossum, James C. Ahlstrom: Internet Programming > with Python. MIS

Re: [Python-Dev] Official citation for Python

2018-09-11 Thread Chris Barker via Python-Dev
On Tue, Sep 11, 2018 at 2:45 PM, Steven D'Aprano wrote: > I think this thread is about *academic* citations. yes, I assumed that as well, what in any of my posts made you think otherwise? > There's a metric ton of information on the web about citing software, > there are existing standards,

Re: [Python-Dev] Official citation for Python

2018-09-11 Thread Chris Barker via Python-Dev
On Tue, Sep 11, 2018 at 3:48 AM, Steven D'Aprano wrote: > > That is about reproducible results, which is really a different thing > than > > the usual citations. > > I don't think it is. I think you are seeing a distinction that is not > there. no need for us to agree on that, but there are

Re: [Python-Dev] Official citation for Python

2018-09-10 Thread Chris Barker via Python-Dev
t; >> Jackie Kazil >> Board of Directors, PSF >> >> >> >> ___ >> Python-Dev mailing list >> Python-Dev@python.org >> https://mail.python.org/mailman/listinfo/python-dev >> Unsubscribe: https://m

Re: [Python-Dev] Issue?

2018-08-22 Thread Chris Barker via Python-Dev
python used the "timsort" sorting routine: https://en.wikipedia.org/wiki/Timsort So you can look at that and confirm that this is correct behaviour (I'm betting it is :-) But in general, sorting is O(n log(n)) -- there are going to be more than n comparisons. If comparing is slow, you want to

Re: [Python-Dev] Pre- and post-conditions

2018-08-15 Thread Chris Barker via Python-Dev
This is an appropriate topic for pyton-ideas: https://mail.python.org/mailman/listinfo/python-ideas not python-dev. I'm sure you'll find interest in your idea there. -CHB On Wed, Aug 15, 2018 at 1:25 AM, Marko Ristin-Kaufmann < marko.ris...@gmail.com> wrote: > Hi python devs, > > I would be

Re: [Python-Dev] Error message for wrong number of arguments

2018-08-02 Thread Chris Barker via Python-Dev
On Wed, Aug 1, 2018 at 2:40 PM, Armin Rigo wrote: > On 30 July 2018 at 22:19, Chris Barker via Python-Dev > wrote: > > Oh well. This is a serious usability issue -- but what can you do? > > I think that argument clinic knows if the built-in function is > supposed to be a

Re: [Python-Dev] Error message for wrong number of arguments

2018-07-30 Thread Chris Barker via Python-Dev
On Mon, Jul 30, 2018 at 11:39 AM, Jeroen Demeyer wrote: > On 2018-07-30 20:22, Chris Barker wrote: > >> is it possible for the interpreter to know when this error is >> generated that this is a bound method expecting a "self", rather than an >> ar

Re: [Python-Dev] Error message for wrong number of arguments

2018-07-30 Thread Chris Barker via Python-Dev
On Mon, Jul 30, 2018 at 5:12 AM, Jeroen Demeyer wrote: > I think it has been argued before that it's a feature that self is > counted. I suppose it is, as it's technically correct, but it's also a HUGE source of confusion, particularly for newbies. IF this is being touched anyway, is it

Re: [Python-Dev] PEP 572 and assert

2018-07-17 Thread Chris Barker via Python-Dev
> > I don't see why. As Chris said, side effects in asserts are nothing new > and > Indeed -- this new feature makes it easier to affect the local scope in all sorts of new places. It was decided that the additional complexity is worth it to make the language more expressive, and it was also

Re: [Python-Dev] Const access to CPython objects outside of GIL?

2018-07-17 Thread Chris Barker via Python-Dev
On Tue, Jul 17, 2018 at 4:34 AM, Victor Stinner wrote: > > IMHO you need a different approach to implement optimizations. For > example, use your objects which don't rely on the GIL to be > consistent. Sadly, I have no experience with that and so cannot > provide any example. > I DO NOT

Re: [Python-Dev] Naming comprehension syntax [was Re: Informal educator feedback on PEP 572 ...]

2018-07-15 Thread Chris Barker via Python-Dev
Thanks Nick, I'll adopt this approach when I update my teaching materials. If I think of it, I"ll post here when I do that -CHB On Sun, Jul 15, 2018 at 12:21 AM, Nick Coghlan wrote: > On 13 July 2018 at 15:30, Chris Barker via Python-Dev > wrote: > > On Mon, Jul 9, 2018

Re: [Python-Dev] Naming comprehension syntax [was Re: Informal educator feedback on PEP 572 ...]

2018-07-12 Thread Chris Barker via Python-Dev
On Mon, Jul 9, 2018 at 3:18 PM, Guido van Rossum wrote: > Definitely docs first. And we should keep references to generator > expressions too, if only to explain that they've been renamed. > > Perhaps someone should try it out in a 3rd party tutorial to see how it > goes? > I'm not sure what

Re: [Python-Dev] Naming comprehension syntax [was Re: Informal educator feedback on PEP 572 ...]

2018-07-09 Thread Chris Barker - NOAA Federal via Python-Dev
TL;DR- +1 on advocating the term “generator comprehension” as a synonym for “generator expression” in future documentation and instructional materials. The long version: If we were starting from scratch, maybe it would makes sense to use “ builder” or something else, rather than comprehension.

Re: [Python-Dev] Naming comprehension syntax [was Re: Informal educator feedback on PEP 572 ...]

2018-07-06 Thread Chris Barker - NOAA Federal via Python-Dev
Are we just having fun here? Or might we actually start using a new naming convention for the-syntax-formerly-known-as-generator-expressions? -CHB Sent from my iPhone > On Jul 3, 2018, at 11:54 PM, Greg Ewing wrote: > > Steven D'Aprano wrote: >> - list builder syntax is syntax which returns a

Re: [Python-Dev] Examples for PEP 572

2018-07-05 Thread Chris Barker via Python-Dev
On Wed, Jul 4, 2018 at 7:20 AM, David Mertz wrote: > > That said, this is a silly game either way. And even though you CAN > (sometimes) bind in an expression pre-572, that's one of those perverse > corners that one shouldn't actually use. > not only shouldn't by hardly anyone ever does /

Re: [Python-Dev] Examples for PEP 572

2018-07-03 Thread Chris Barker via Python-Dev
On Tue, Jul 3, 2018 at 2:51 PM, Chris Angelico wrote: > On Wed, Jul 4, 2018 at 7:37 AM, Serhiy Storchaka > wrote: > > I believe most Python users are not > > professional programmers -- they are sysadmins, scientists, hobbyists and > > kids -- > > [citation needed] fair enough, but I think we

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-07-03 Thread Chris Barker via Python-Dev
On Mon, Jul 2, 2018 at 11:42 PM, Tim Peters wrote: > "comprehensions" was always a dubious term, carried over from set theory > where the term focuses on the optional "if" part rather than the more > fundamental iterator or computation parts. > I always wondered about that :-) -- I'd say for

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-07-02 Thread Chris Barker - NOAA Federal via Python-Dev
> On Jul 2, 2018, at 8:34 AM, Steven D'Aprano wrote: Guido has decided — and despite my concerns, I’m going to enjoy my new loop-and-a half construct:-) But a comment on this: > comprehension are no more special than > assignments inside any other expression. They bind in the current scope, >

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-07-02 Thread Chris Barker via Python-Dev
On Sun, Jul 1, 2018 at 5:25 PM, Steven D'Aprano wrote: > > > an optional topic. Once widely used, it ain't optional. > > Without knowing the details of your course, and who they are aimed at, > we cannot possibly judge this comment. Decorators are widely used, but > surely you don't teach them

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-07-01 Thread Chris Barker via Python-Dev
On Sun, Jul 1, 2018 at 8:35 AM, Michael Selik wrote: > As Mark and Chris said (quoting Mark below), this is just one straw in the > struggle against piling too many things on the haystack. Unlike some > changes to the language, this change of such general use that it won't be > an optional

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-06-29 Thread Chris Barker - NOAA Federal via Python-Dev
> On Jun 28, 2018, at 8:21 PM, Tim Peters wrote: Seems it’s all been said, and Tim’s latest response made an excellent case for consistency. But: > Regardless of how assignment expressions work in listcomps and genexps, this > example (which uses neither) _will_ rebind the containing block's

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-06-28 Thread Chris Barker via Python-Dev
On Thu, Jun 28, 2018 at 9:28 AM, Tim Peters wrote: > >>> g = (x:=i for i in range(3)) > Common or not, I have no idea why anyone would write a genexp like the one > you gave, except to contrive an example of silly behavior exhibited by > silly code ;-) > yes, it was a contrived example, but the

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-06-28 Thread Chris Barker - NOAA Federal via Python-Dev
Sent from my iPhone > > So what about: > > > > l = [x:=i for i in range(3)] > > > > vs > > > > g = (x:=i for i in range(3)) > > > > Is there any way to keep these consistent if the "x" is in the regular > > local scope? > > I'm not clear on what the question is. The list comprehension would

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-06-27 Thread Chris Barker via Python-Dev
On Wed, Jun 27, 2018 at 12:01 PM, Eric V. Smith wrote: > >>> def test(): > >>>spam = 1 > >>>ham = 2 > >>>vars = [key1+key2 for key1 in locals() for key2 in locals()] > >>>return vars > >>> > >>> Wanna guess what that's gonna return? > Guessing aside, messing around with locals()

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-06-22 Thread Chris Barker via Python-Dev
On Fri, Jun 22, 2018 at 7:23 PM, Steven D'Aprano wrote: > > But once it becomes a more common idiom, students will see it in the wild > > pretty early in their path to learning python. So we'll need to start > > introducing it earlier than later. > > Students see many features early in their

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-06-22 Thread Chris Barker via Python-Dev
On Fri, Jun 22, 2018 at 10:09 AM, Michael Selik wrote: > I forgot to add that I don't anticipate changing my lesson plans if this > proposal is accepted. There's already not enough time to teach everything > I'd like. Including a new assignment operator would distract from the > learning

Re: [Python-Dev] A more flexible task creation

2018-06-14 Thread Chris Barker via Python-Dev
Excuse my ignorance (or maybe it's a vocabulary thing), but I'm trying to understand the problem here. But if I have this right: I've been using asyncio a lot lately and have encountered this problem > several times. Imagine you want to do a lot of queries against a database, > spawning 1

Re: [Python-Dev] Microsoft to acquire GitHub for $7.5 b

2018-06-07 Thread Chris Barker - NOAA Federal via Python-Dev
> We shouldn't be uniquely or especially concerned just because > Microsoft has purchased Github. Nothing has changed. Exactly — but this change HAS made people think about an issue that we should have already been thinking about. At the end of the day, anyone, or any project, would be well

Re: [Python-Dev] Docstrings on builtins

2018-06-06 Thread Chris Barker via Python-Dev
t is useless we can attempt to get the signature >> from __new__ and show that instead. We do similar things for docstrings, >> if __init__ have no docstring we look at the class level docstring. >> -- >> M >> >> >> >> ___

Re: [Python-Dev] Docstrings on builtins

2018-06-05 Thread Chris Barker via Python-Dev
OK, looking a bit deeper: In [69]: timedelta.__new__.__doc__ Out[69]: 'Create and return a new object. See help(type) for accurate signature.' In [70]: timedelta.__init__.__doc__ Out[70]: 'Initialize self. See help(type(self)) for accurate signature.' In [71]: timedelta.__doc__ Out[71]:

Re: [Python-Dev] Docstrings on builtins

2018-06-04 Thread Chris Barker - NOAA Federal via Python-Dev
> > This may even be a bug/feature of IPython, Ahh, thanks! I’ll look into that. -CHB ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Docstrings on builtins

2018-06-04 Thread Chris Barker via Python-Dev
t; Clinic and then run "make clinic" to regenerate the generated files. > good idea. Now to find some time to actually work on this... -CHB > Victor > > 2018-06-04 23:45 GMT+02:00 Chris Barker via Python-Dev < > python-dev@python.org>: > > Over on p

[Python-Dev] Docstrings on builtins

2018-06-04 Thread Chris Barker via Python-Dev
Over on python-ideas, someone is/was proposing literals for timedeltas. I don't expect that will come to anything, but it did make me take a look at the docstring for datetime.timedelta. I use iPython's ? a lot for a quick overview of how to use a class/function. This is what I get: In [8]:

Re: [Python-Dev] (Looking for) A Retrospective on the Move to Python 3

2018-05-14 Thread Chris Barker - NOAA Federal via Python-Dev
> between 3.0 and 3.6 (.5?) -- py3 grew a lot of minor features that made it >> easier to write py2/py3 compatible code. >> u"string", b'bytes %i' % something -- and when where the various >> __future__ imports made available? >> > > You'll need to be more specific. __future__ has been around for

Re: [Python-Dev] (Looking for) A Retrospective on the Move to Python 3

2018-05-14 Thread Chris Barker via Python-Dev
On Sat, May 12, 2018 at 8:14 AM, Skip Montanaro wrote: > > I have found 2to3 conversion to be remarkably easy and painless. > > > And the whole Unicode thing is much easier. > Another point here: between 3.0 and 3.6 (.5?) -- py3 grew a lot of minor features that made

Re: [Python-Dev] Python startup time

2018-05-14 Thread Chris Barker via Python-Dev
On Mon, May 14, 2018 at 12:33 PM, INADA Naoki wrote: > It will broke hash randomization. > > See also: https://www.cvedetails.com/cve/CVE-2017-11499/ I'm not enough of a security expert to know how much that matters in this case, but I suppose one could do a bit of

Re: [Python-Dev] Python startup time

2018-05-14 Thread Chris Barker via Python-Dev
On Fri, May 11, 2018 at 11:05 AM, Ryan Gonzalez wrote: > https://refi64.com/uprocd/ very cool -- but *nix only, of course :-( But it seems that there is a demand for this sort of thing, and a few major projects are rolling their own. So maybe it makes sense to put

Re: [Python-Dev] bpo-33257: seeking advice & approval on the course of action

2018-05-14 Thread Chris Barker via Python-Dev
On Wed, May 2, 2018 at 8:21 PM, Terry Reedy wrote: > On 5/2/2018 4:38 PM, Ivan Pozdeev via Python-Dev wrote: > >> The bottom line is: Tkinter is currently broken >> > > This is way over-stated. Many modules have bugs, somethings in features > more central to their main

Re: [Python-Dev] (Looking for) A Retrospective on the Move to Python 3

2018-05-11 Thread Chris Barker - NOAA Federal via Python-Dev
> while the changes introduced by Python 3 > affect pretty much everyone, even people who only write small simple > scripts. Sure they do, but the *hard stuff* not so much. I have found 2to3 conversion to be remarkably easy and painless. And the whole Unicode thing is much easier. CHB >

Re: [Python-Dev] Python startup time

2018-05-11 Thread Chris Barker - NOAA Federal via Python-Dev
Inspired by chg: Could one make a little startup utility that, when invoked the first time, starts up a raw python interpreter, keeps it running somewhere, and then forks it to run the actual python code. Then every invocation after that would make a new fork. I presume forking is a LOT faster

Re: [Python-Dev] (name := expression) doesn't fit the narrative of PEP 20

2018-04-27 Thread Chris Barker
On Thu, Apr 26, 2018 at 1:33 PM, Tim Peters wrote: > And that *is* a thing that you will have to explain to newbies when they > encounter > > it for the first time. > > Sure. That doesn't frighten me, though. It's easy to explain what it > does - although it may be hard

Re: [Python-Dev] PEP 572: Write vs Read, Understand and Control Flow

2018-04-27 Thread Chris Barker
On Tue, Apr 24, 2018 at 2:21 AM, Victor Stinner wrote: > Even if the C language allows assignments in if, I avoid them, because > I regularly have to debug my own code in gdb ;-) > I personally haven't written a lot of C, so have no personal experience, but if this is at

Re: [Python-Dev] PEP 572: Assignment Expressions

2018-04-20 Thread Chris Barker - NOAA Federal
> Personally, I even slightly prefer > > a := 3 > > to the commonplace > > a = 3 > because it visually expresses the asymmetry of the operation. Careful here! That’s a fine argument for using := in a new language, but people using := when they don’t need an expression because they like the symbol

Re: [Python-Dev] PEP 572: Assignment Expressions

2018-04-19 Thread Chris Barker - NOAA Federal
> On Apr 19, 2018, at 4:27 PM, Christoph Groth wrote: > def sync_runner(learner, f, static_hint): >while True: >points = learner.get(static_hint) >if not points: >break >learner.feed(f(points)) > > > > With assignment

Re: [Python-Dev] PEP 572: Assignment Expressions

2018-04-19 Thread Chris Barker
On Thu, Apr 19, 2018 at 5:45 AM, Nick Coghlan wrote: > * for the while loop use case, I think my discussion with Tim about > tuple unpacking shows that the loop-and-a-half construct won't be > going anywhere, so users would still end up needing to learn both > forms (even for

Re: [Python-Dev] Soliciting comments on the future of the cmd module (bpo-33233)

2018-04-07 Thread Chris Barker - NOAA Federal
Is bringing cmd2 into the standard library an option to be considered? That water get included batteries and a more featurefull and supported lib. It seems (on python-ideas) that people are often told, when they have a suggestion for the stdlib, that they put it on pypi and see if it gains

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-27 Thread Chris Barker
, but might if we wanted to add a generic is_integer() function somewhere. In any case, I don’t recall it being mentioned in the conversation, so thought I’d complete the record. -CHB On Wed, Mar 21, 2018 at 8:31 PM Guido van Rossum <gu...@python.org> wrote: > On Wed, Mar 21, 2018 at 6:48

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-21 Thread Chris Barker
On Wed, Mar 21, 2018 at 4:12 PM, Guido van Rossum wrote: > Thank you! As you may or may not have noticed in a different thread, we're > going through a small existential crisis regarding the usefulness of > is_integer() -- Serhiy believes it is not useful (and even an

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-21 Thread Chris Barker
On Wed, Mar 21, 2018 at 12:38 PM, Steven D'Aprano wrote: > In fact, Serhiy's suggestion is not correct when x is not a float: > This is a key point -- see some of Tim's posts -- like ot or not, you probably need to know when you are working with a float and when you aren't

Re: [Python-Dev] Deprecating float.is_integer()

2018-03-21 Thread Chris Barker
On Wed, Mar 21, 2018 at 11:43 PM, Tim Peters wrote: > Note: this is a top-posted essay much more about floating-point > philosophy than about details. Details follow from the philosophy, > and if philosophies don't match the desired details will never match > either. >

Re: [Python-Dev] Deprecating float.is_integer()

2018-03-21 Thread Chris Barker
> > > Does anybody know examples of the correct use of float.is_integer() in > real programs? For now it looks just like a bug magnet. I suggest to > deprecate it in 3.7 or 3.8 and remove in 3.9 or 3.10. +1 It really doesn’t appear to be the right solution for any problem. -CHB --

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-21 Thread Chris Barker
On Wed, Mar 21, 2018 at 4:42 AM Steven D'Aprano wrote: > > > > Could float et al. add an __index__ method that would return a ValueError > > if the value was not an integer? > > That would allow us to write things like: > > "abcdefgh"[5.0] > > which is one of the things

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-20 Thread Chris Barker
It seems .as_integer_ratio() has been resolved. what about the original .is_integer() request? (Or did I miss that somehow?) Anyway, it seems like __index__() should play a role here somehow... isn't that how you ask an object for the integer version of itself? Could float et al. add an

Re: [Python-Dev] ttk.Treeview.insert() does not allow to insert item with iid=0

2018-03-20 Thread Chris Barker
On Fri, Mar 16, 2018 at 10:54 AM, Игорь Яковченко wrote: > I investigated problem and found that in ttk.py, Treeview.insert(... > iid=None, ...) in method's body has a check: > if iid: > res = self.tk.call(self._w, "insert", parent, index, >

Re: [Python-Dev] The `for y in [x]` idiom in comprehensions

2018-02-23 Thread Chris Barker
On Fri, Feb 23, 2018 at 10:45 AM, Guido van Rossum wrote: > There are useful things you can only do with comprehensions if the second > for-loop can use the variable in the first for-loop. E.g. > > [(i, j) for i in range(10) for j in range(i)] > indeed -- and that is fairly

Re: [Python-Dev] The `for y in [x]` idiom in comprehensions

2018-02-23 Thread Chris Barker
On Fri, Feb 23, 2018 at 9:51 AM, Guido van Rossum wrote: > As to the validity or legality of this code, it's both, and working as > intended. > > A list comprehension of the form > > [STUFF for VAR1 in SEQ1 for VAR2 in SEQ2 for VAR3 in SEQ3] > > should be seen (informally)

Re: [Python-Dev] The `for y in [x]` idiom in comprehensions

2018-02-23 Thread Chris Barker - NOAA Federal
> Is it similar enough to > >def f(x=[0]): No, not at all — it’s a very different use case. When I first saw this on the original thread, I needed to stare at it a good while, and then whip up some code to experiment with it to know what it did. And not because I don’t know what a single

Re: [Python-Dev] PEP 467 (Minor API improvements for binary sequences) - any thoughts?

2018-02-21 Thread Chris Barker
On Wed, Feb 21, 2018 at 12:39 PM, Steve Holden wrote: > I think the chances of a "byte" object are about as good as the chances of > a character object > probably right. > (though one can always implement such in C extensions, that wouldn't build > them into the syntax).

Re: [Python-Dev] PEP 467 (Minor API improvements for binary sequences) - any thoughts?

2018-02-21 Thread Chris Barker
On Wed, Feb 21, 2018 at 12:21 PM, Ethan Furman wrote: > At this point the PEP itself has not been approved, and is undergoing > changes. I don't see anything happening with it right now while 3.7 is > going through it's final stages to release. Once 3.7.0 is published we

  1   2   3   4   >