[Python-Dev] Python3 compiled listcomp can't see local var - bug or feature?

2018-06-05 Thread Rob Cliffe via Python-Dev
Is this a bug or a feature? Consider the following program: # TestProgram.py def Test():   # global x     x = 1     exec(compile('print([x+1,x+2])', 'MyTest', 'exec'))     exec(compile('print([x+i for i in range(1,3)])', 'MyTest', 'exec&

Re: [Python-Dev] Keeping an eye on Travis CI, AppVeyor and buildbots: revert on regression

2018-06-06 Thread Ivan Pozdeev via Python-Dev
not see it whereas I'm logged in in the Python organization. Last I checked, they wrote it's only available for paid accounts (on travis-ci.com) by default and only enabled for others on a case-by-case basis, but I cannot find this info now. So suggest you make a support ticket at https://

Re: [Python-Dev] Docstrings on builtins

2018-06-06 Thread Chris Barker via Python-Dev
on, Jun 4, 2018 at 6:21 PM, Matthias Bussonnier < > bussonniermatth...@gmail.com> wrote: > >> >> >> On Mon, 4 Jun 2018 at 17:29, Ivan Pozdeev via Python-Dev < >> python-dev@python.org> wrote: >> >>> On 05.06.2018 3:09, Matthias Bussonnier wrote: >

Re: [Python-Dev] Python3 compiled listcomp can't see local var - bug or feature?

2018-06-11 Thread Rob Cliffe via Python-Dev
e out of the list comprehension was a bad idea. Think of the Py3 behavior as one of those "corrections" to things which were "got wrong" in Python 1 or 2. :-) Skip --- This email has been checked for viruses by AVG. http://www.avg.com ______

Re: [Python-Dev] Python3 compiled listcomp can't see local var - bug or feature?

2018-06-12 Thread Rob Cliffe via Python-Dev
Ah yes, I see what you mean: class Test():    x = 1    print (x) # Prints 1    print([x+i for i in range(1,3)])  # NameError (x) Anyway, I  apologise for posting to Python-Dev on was a known issue, and turned out to be more me asking for help with

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

2018-06-14 Thread Chris Barker via Python-Dev
attle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] About [].append == [].append

2018-06-21 Thread Ivan Pozdeev via Python-Dev
me dichotomy in the minds of the .__eq__ designers, and Python Zen advises "In the face of ambiguity, refuse the temptation to guess." -- which is what you're suggesting. On 21.06.2018 14:25, Jeroen Demeyer wrote: Currently, we have: >>> [].append == [].append False H

Re: [Python-Dev] About [].append == [].append

2018-06-21 Thread Ivan Pozdeev via Python-Dev
On 21.06.2018 16:39, Steven D'Aprano wrote: On Thu, Jun 21, 2018 at 02:33:27PM +0300, Ivan Pozdeev via Python-Dev wrote: First, tell us what problem you're solving. You might not be aware of the context of Jereon's question. He is the author of PEP 579 and 580, so I expect he

Re: [Python-Dev] About [].append == [].append

2018-06-21 Thread Ivan Pozdeev via Python-Dev
od's author (that you might be familiar with) was thinking in https://github.com/python/cpython/commit/47b9ff6ba11fab4c90556357c437cb4feec1e853 -- and even then and there, they were hesitant about the feature's usefulness. But Serhiy has just disproven that that is the right way w

Re: [Python-Dev] About [].append == [].append

2018-06-22 Thread Ivan Pozdeev via Python-Dev
see anything in the docs about method equality semantics. If that's true, it's an implementation detail, and users shouldn't rely on it. Consequently, anything is "desirable" that is sufficient for the Python codebase. -- Regards, Ivan _______

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
ract from the > learning objectives. > nor would I. For a while, anyway 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. I think this reflects that the "

Re: [Python-Dev] PySequence_Check but no __len__

2018-06-22 Thread Ivan Pozdeev via Python-Dev
d that a C-API function calls something a 'sequence' without it having __len__. A practical sequence check is checking for __iter__ . An iterator doesn't necessarily have a defined length -- e.g. a stream or a generator. -- Regards, Ivan _____

Re: [Python-Dev] PySequence_Check but no __len__

2018-06-22 Thread Ivan Pozdeev via Python-Dev
ow this isn't what https://docs.python.org/3/glossary.html#term-sequence says. But practically, the documentation seems to use "sequence" in the sense "finite iterable". Functions that need to know the length of input in advance seem to be the minority. -- Regards, Ivan

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. > > Student

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

2018-06-23 Thread Ivan Pozdeev via Python-Dev
e a clear preference for shorter, simpler lines at the consequence of more lines of code. Of course they do -- they're less fluent at reading code. They don't have the experience to judge good code from bad. The question we should be asking is, do we only add features to Python if they ar

Re: [Python-Dev] We now have C code coverage!

2018-06-23 Thread Ivan Pozdeev via Python-Dev
On 23.06.2018 13:52, Paul Moore wrote: On 22 June 2018 at 23:21, Brett Cannon wrote: Thanks to a PR from Ammar Askar we now run Python under lcov as part of the code coverage build. And thanks to codecov.io automatically merging code coverage reports we get a complete report of our coverage

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

2018-06-24 Thread Ivan Pozdeev via Python-Dev
It's not saying "def" or "lambda", which obviously create functions. It's a 'for' loop wrapped inside a list display. What part of that says "hey, I'm a nested function"? So if there's an implicit function, with implicit declaration of a mag

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

2018-06-25 Thread Ivan Pozdeev via Python-Dev
table. Brief summary of reasons for disliking ":=": * Cryptic use of punctuation * Too much overlap in functionality with "=" * Asymmetry between first and subsequent uses of the bound value * Makes expressions cluttered and hard to read to my eyes -- Regards, Ivan ___

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

2018-06-25 Thread Ivan Pozdeev via Python-Dev
ion comprehensions. However, he did post his motivation for (b) on python-ideas, IIRC a bit before PyCon; and the main text of the PEP gives a strong motivation (https://www.python.org/dev/peps/pep-0572/#scope-of-the-target). Nevertheless, maybe we should compromise and drop (b)? Unfortunately, I th

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

2018-06-26 Thread Ivan Pozdeev via Python-Dev
would be people who feel strongly that the change to the comprehension scope rules in Python 3 is a big improvement, I might not be one of those 'most horrified' by (b), but I increasingly don't like it, and I was at best -0 on the comprehension scope chan

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

2018-06-26 Thread Ivan Pozdeev via Python-Dev
place, and even they struggle is there were multiple. A discussion long past, and a discussion yet to come. There are no beginnings or endings in the Wheel of Python... -- Regards, Ivan ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Policy on refactoring/clean up

2018-06-26 Thread Ivan Pozdeev via Python-Dev
On 26.06.2018 12:00, Jeroen Demeyer wrote: Hello, On https://github.com/python/cpython/pull/7909 I encountered friction for a PR which I expected to be uncontroversial: it just moves some code without changing any functionality. So basically my question is: is there some CPython policy

Re: [Python-Dev] Policy on refactoring/clean up

2018-06-26 Thread Ivan Pozdeev via Python-Dev
On 26.06.2018 14:43, Jeroen Demeyer wrote: On 2018-06-26 13:11, Ivan Pozdeev via Python-Dev wrote: AFAICS, your PR is not a strict improvement What does "strict improvement" even mean? Many changes are not strict improvements, but still useful to have. Inada pointed me to YAG

Re: [Python-Dev] Policy on refactoring/clean up

2018-06-26 Thread Ivan Pozdeev via Python-Dev
On 26.06.2018 14:54, INADA Naoki wrote: On Tue, Jun 26, 2018 at 8:46 PM Jeroen Demeyer <mailto:j.deme...@ugent.be>> wrote: On 2018-06-26 13:11, Ivan Pozdeev via Python-Dev wrote: > AFAICS, your PR is not a strict improvement What does "strict improvement" e

Re: [Python-Dev] Policy on refactoring/clean up

2018-06-26 Thread Ivan Pozdeev via Python-Dev
On 26.06.2018 14:54, Ivan Pozdeev via Python-Dev wrote: On 26.06.2018 14:43, Jeroen Demeyer wrote: On 2018-06-26 13:11, Ivan Pozdeev via Python-Dev wrote: AFAICS, your PR is not a strict improvement What does "strict improvement" even mean? Many changes are not strict improve

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

2018-06-27 Thread Ivan Pozdeev via Python-Dev
On 26.06.2018 1:34, Greg Ewing wrote: Ivan Pozdeev via Python-Dev wrote: "as" was suggested even before is became a keyword in `with'. ( if (re.match(regex,line) as m) is not None: ) That's not equivalent where/given, though, since it still has the asymmetry problem.

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

2018-06-27 Thread Ivan Pozdeev via Python-Dev
ut it the (b) scoping rule change > would be people who feel strongly that the change to the > comprehension scope rules in Python 3 is a big improvement, I might not be one of those 'most horrified' by (b), but I increasingly don't like it, and I was

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

2018-06-27 Thread Ivan Pozdeev via Python-Dev
On 27.06.2018 16:25, Greg Ewing wrote: Ivan Pozdeev via Python-Dev wrote: Using this assigned result elsewhere in the same expression (akin to regex backreferences) is not a part of the basic idea actually. If that's true, then the proposal has mutated into something that has *no* ov

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

2018-06-27 Thread Ivan Pozdeev via Python-Dev
ns themselves require an implicit function. And what we get out of this is simpler semantics at the Python level: - Unless previous declared global, assignment expressions always bind to the current scope, even if they're inside a comprehension; - and we don't have to deal with the od

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

2018-06-27 Thread Ivan Pozdeev via Python-Dev
On 28.06.2018 1:42, Steven D'Aprano wrote: On Wed, Jun 27, 2018 at 05:52:16PM +0300, Ivan Pozdeev via Python-Dev wrote: What this means in practice is that assignments will go to different scopes depending on *where* they are in the comprehension: [ expr for x in iter1 for y in

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

2018-06-27 Thread Ivan Pozdeev via Python-Dev
On 28.06.2018 2:31, Ivan Pozdeev via Python-Dev wrote: On 28.06.2018 1:42, Steven D'Aprano wrote: On Wed, Jun 27, 2018 at 05:52:16PM +0300, Ivan Pozdeev via Python-Dev wrote: What this means in practice is that assignments will go to different scopes depending on *where* they are i

Re: [Python-Dev] Enable access to the AST for Python code

2015-05-21 Thread Peter Ludemann via Python-Dev
ect.getsource(), but going straight >>> to the AST. >>> >> >> Is it really that much different? The end result is >> the same -- the user writes something that looks like >> a Python expression, but it gets evaluated using some >> other set of semantics that c

[Python-Dev] Python automatic optimization

2015-07-23 Thread Andrew Steinberg via Python-Dev
Hello everybody, I am using Python 2.7 as a backbone for some mathematical simulations. I recently discovered a tool called AutoFDO and I tried compiling my own Python version, but I did not manage to get it working. My question is, will sometime in the future Python include this tool? Thank

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-09 Thread Peter Ludemann via Python-Dev
Most of my outputs are log messages, so this proposal won't help me because (I presume) it does eager evaluation of the format string and the logging methods are designed to do lazy evaluation. Python doesn't have anything like Lisp's "special forms", so there do

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-09 Thread Peter Ludemann via Python-Dev
])) On 9 August 2015 at 15:25, Brett Cannon wrote: > > On Sun, Aug 9, 2015, 13:51 Peter Ludemann via Python-Dev < > python-dev@python.org> wrote: > > Most of my outputs are log messages, so this proposal won't help me > because (I presume) it does eager evaluation of

Re: [Python-Dev] PEP-498 & PEP-501: Literal String Formatting/Interpolation

2015-08-16 Thread Peter Ludemann via Python-Dev
Aug 9, 2015 at 3:25 PM Brett Cannon wrote: > >> >> On Sun, Aug 9, 2015, 13:51 Peter Ludemann via Python-Dev < >> python-dev@python.org> wrote: >> >> Most of my outputs are log messages, so this proposal won't help me >> because (I presume) it doe

Re: [Python-Dev] type(obj) vs. obj.__class__

2015-10-18 Thread Peter Ludemann via Python-Dev
e concrete guidelines about >> > when to use type(obj) vs. obj.__class__? If so, what would those be? >> > It may also be helpful to enumerate use cases for "type(obj) is not >> > obj.__class__". >> >> I for one would like to see a definitive explanat

Re: [Python-Dev] type(obj) vs. obj.__class__

2015-10-18 Thread Peter Ludemann via Python-Dev
ever way, for the same performance, to demonstrate that there's no need to assign to __class__. collections.deque is about 5x faster. (My simple benchmark tests the cost of x.append(i)) - p​ > > ChrisA > ___ > Python-Dev mailing list &g

[Python-Dev] "python.exe is not a valid Win32 app"

2015-12-01 Thread Alexei Belenki via Python-Dev
Installed python 3.5 (from https://www.python.org/downloads/) on Windows XPsp3/32 On starting >>python.exe got the text above in the Windows message box. Any suggestions?Thanks.AB___ Python-Dev mailing list Python-Dev@python.org https://mail.pyth

Re: [Python-Dev] Deleting with setting C API functions

2015-12-02 Thread Andrew Barnert via Python-Dev
On Dec 2, 2015, at 07:01, Random832 wrote: > > On 2015-12-02, Victor Stinner wrote: >>> Are there plans for a Python 4? >> >> No. Don't. Don't schedule any "removal" or *any* kind of "break >> backward compatibility" anymore, or yo

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Andrew Barnert via Python-Dev
contain functions, etc. A non-comprehension display can include function calls, lambdas, or any other kind of expression, just as easily as a comprehension can. Is [1, x, f(y), lambda z: w+z] a literal? If so, why isn't [i*x for i in y] a literal? The problem is that we need a word that di

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Andrew Barnert via Python-Dev
On Dec 3, 2015, at 17:25, Steven D'Aprano wrote: > > On Thu, Dec 03, 2015 at 09:25:53AM -0800, Andrew Barnert via Python-Dev wrote: >>> On Dec 3, 2015, at 08:15, MRAB wrote: >>> >>>>> On 2015-12-03 15:09, Random832 wrote: >>>>> On 201

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-04 Thread Andrew Barnert via Python-Dev
On Dec 4, 2015, at 00:38, Nick Coghlan wrote: > > On 4 December 2015 at 12:48, Andrew Barnert via Python-Dev > wrote: >> On Dec 3, 2015, at 17:25, Steven D'Aprano wrote: >>>> On Thu, Dec 03, 2015 at 09:25:53AM -0800, Andrew Barnert via Python-Dev >>>&

Re: [Python-Dev] A function for Find-Replace in lists

2015-12-09 Thread Andrew Barnert via Python-Dev
On Dec 9, 2015, at 03:43, טל ח wrote: > > Hi, > > I think it could be helpful for everyone if the function proposed by user > "SomethingSomething" can be added as built-in > in Python Why? When he was asked what use it might have, he didn't have an answer.

Re: [Python-Dev] async/await behavior on multiple calls

2015-12-15 Thread Andrew Barnert via Python-Dev
ce impact for code that works with raw coroutines and doesn't need real futures to get them wrapped in futures anyway? ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://

Re: [Python-Dev] async/await behavior on multiple calls

2015-12-16 Thread Andrew Barnert via Python-Dev
Given that most other >> languages have standardized around async returning a Future as >> opposed to a coroutine I think it's worth exploring why Python >> differs. > > Sorry, but what makes you think that it's worth exploring why Python > Python differs, and not

Re: [Python-Dev] Idea: Dictionary references

2015-12-17 Thread Andrew Barnert via Python-Dev
ere, but it's a really confusing use of terminology. In Python, and in programming in general, nested scopes refer to exactly inner functions (and classes) being lexically nested and doing lookup through outer scopes. The fact that this is optimized at compile time to FAST vs. CELL vs. GLOBAL/N

Re: [Python-Dev] Idea: Dictionary references

2015-12-17 Thread Andrew Barnert via Python-Dev
oesn't make sense. Maybe someone who's better at explaining than me can come up with something clearer than the existing documentation, but I can't. _______ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailma

Re: [Python-Dev] Idea: Dictionary references

2015-12-17 Thread Andrew Barnert via Python-Dev
On Dec 17, 2015, at 13:37, Andrew Barnert via Python-Dev wrote: > > On Thursday, December 17, 2015 11:19 AM, Franklin? Lee > wrote: > > >> ... >> as soon as I figure out how descriptors actually work... > > > I think you need to learn what LOAD_ATTR

Re: [Python-Dev] Idea: Dictionary references

2015-12-17 Thread Andrew Barnert via Python-Dev
the descriptor call, you can cache the descriptor itself but it will rarely help, and the builtin method cache probably already takes care of 99% of the cases where it would help, so I don't see what you're going to get here. >> On Thu, Dec 17, 2015 at 5:17 PM, Andrew Barnert w

Re: [Python-Dev] Idea: Dictionary references

2015-12-18 Thread Andrew Barnert via Python-Dev
> On Dec 18, 2015, at 04:56, Steven D'Aprano wrote: > >>> On Thu, Dec 17, 2015 at 09:30:24AM -0800, Andrew Barnert via Python-Dev >>> wrote: >>> On Dec 17, 2015, at 07:38, Franklin? Lee >>> wrote: >>> >>> The nested dicti

Re: [Python-Dev] Asynchronous context manager in a typical network server

2015-12-18 Thread Andrew Barnert via Python-Dev
) and it really does look misleading to people who aren't warped like that? If so, would it be worth having an actual way to say "sleep forever (until canceled)"? Even if, under the covers, this only sleeps for 5 years or so, a Y52K problem that can be solved by just pushing

Re: [Python-Dev] Asynchronous context manager in a typical network server

2015-12-18 Thread Andrew Barnert via Python-Dev
rs. It's 11 days. Which is pretty reasonable server uptime. And probably just outside the longest test you're ever going to run. I don't trust myself to pick "a big number" when the numbers get this big. But I still sometimes sneak one past myself somehow. Hence my sugg

Re: [Python-Dev] Asynchronous context manager in a typical network server

2015-12-18 Thread Andrew Barnert via Python-Dev
th a constant so you can just say "sleep(FOREVER)". Which, in Python terms, would presumably mean "asyncio.sleep(asyncio.forever)", and it could be a unique object or an enum value or something instead of actually being -1. * Or at least "until this rolls over 31/32/63/64

Re: [Python-Dev] Change the repr for datetime.timedelta (was Re: Asynchronous context manager in a typical network server)

2015-12-21 Thread Andrew Barnert via Python-Dev
.c (and various other things in the stdlib) not being (completely) argclinicified? Or is there something hairy about this type (and various other things in the stdlib) that makes them still useless even with argclinic? ___ Python-Dev mailing list Python

Re: [Python-Dev] PEP 257 and __init__

2015-12-29 Thread Andrew Barnert via Python-Dev
more experienced in other languages and whose instinctive "taste" isn't sufficiently Pythonic. And for that use case, keeping the rules as simple as possible is probably helpful. Better to have one wasted line in every file than to have an extra rule that all those JS developers ha

Re: [Python-Dev] PEP 257 and __init__

2015-12-29 Thread Andrew Barnert via Python-Dev
conventions of scientific/numerical programming and Django programming, so presumably coming up with your own configuration shouldn't be too hard--don't require docstrings on __init__, or on all special methods, or only when there no __new__, or whatever.)

Re: [Python-Dev] bitwise operations for bytes and bytearray

2016-01-07 Thread Andrew Barnert via Python-Dev
e needs patch stage, which makes it perfect for the OP: in addition to learning how to hack on builtin types, he can also learn the other parts of the dev process. (Even if the bug is eventually rejected, as seems likely given that it sat around for three years with no compelling use case and t

Re: [Python-Dev] bitwise operations for bytes and bytearray

2016-01-09 Thread Andrew Barnert via Python-Dev
On Jan 9, 2016, at 16:17, Blake Griffith wrote: > > A little update, I got ^, &, and | working for bytearrays. You can view the > diff here: > https://github.com/python/cpython/compare/master...cowlicks:bitwise-bytes?expand=1 If you upload the diff to the issue on the track

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-11 Thread Andrew Barnert via Python-Dev
't? If so, that seems reasonable. (The worst case in incrementing the version unnecessarily is that you miss an optimization that would have been safe, right?). _______ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Discussion related to memory leaks requested

2016-01-13 Thread Andrew Barnert via Python-Dev
tree is not getting cleared -- but this opinion is preliminary. > > Best, > > Matt > >> On 1/13/2016 5:10 PM, Victor Stinner wrote: >> Hi, >> >> 2016-01-13 20:32 GMT+01:00 Matthew Paulson : >>> I've spent some time performing memory leak analysis while

[Python-Dev] Should inspect.getargspec take any callable?

2016-01-16 Thread Aviv Cohn via Python-Dev
defaults' is an n-tuple of the default values of the last n arguments.        """             if ismethod(func):            func = func.im_func        if not isfunction(func):            raise TypeError('{!r} is not a Python function'.format(func))       

Re: [Python-Dev] Should inspect.getargspec take any callable?

2016-01-16 Thread Andrew Barnert via Python-Dev
On Jan 16, 2016, at 08:05, Aviv Cohn via Python-Dev wrote: > > The `getargspec` function in the `inspect` module enforces the input > parameter to be either a method or a function. The `getargspec` already works with classes, callable objects, and some builtins. It's also

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-18 Thread Andrew Barnert via Python-Dev
ode, even if it's a simpler change to the PEP. Is that what was intended?___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-18 Thread Peter Ludemann via Python-Dev
On 18 January 2016 at 23:25, Alexander Walters wrote: > > > On 1/19/2016 02:21, Larry Hastings wrote: > > > On 01/18/2016 08:40 PM, Alexander Walters wrote: > > I am not a core developer, but I just kind of feel its hypocritical to > oppose always using brackets for

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-19 Thread Andrew Barnert via Python-Dev
or see your 2-line version in C, I use it quite a bit in C++ (and related languages like D), so it doesn't look at all weird to me. But I'll leave it up to people who only do C (and Python) and/or who are more familiar with the CPython code base to judge. ___

Re: [Python-Dev] Code formatter bot

2016-01-20 Thread Andrew Barnert via Python-Dev
o a human can decide, and so people can see the bug in the plugin or filter--than to automatically make changes that weren't wanted.) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Andrew Barnert via Python-Dev
e version-bumping (maybe unconditionally bump it N times before starting the transaction, and then as long as you don't bump more than N times during the transaction, you can commit without touching it), but there's still going to be a lot of contention. And that also affects somethin

Re: [Python-Dev] FAT Python (lack of) performance

2016-01-25 Thread Andrew Barnert via Python-Dev
On Jan 25, 2016, at 13:43, Victor Stinner wrote: > > According to microbenchmarks, the most promising optimizations are > functions inlining (Python function calls are slow :-/) and specialize > the code for the type of arguments. Can you specialize a function with a C API funct

Re: [Python-Dev] FAT Python (lack of) performance

2016-01-25 Thread Andrew Barnert via Python-Dev
d to see you already thought of that before me. :) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] FAT Python (lack of) performance

2016-01-25 Thread Andrew Barnert via Python-Dev
On Jan 25, 2016, at 18:21, INADA Naoki wrote: > > I'm very interested in it. > > Ruby 2.2 and PHP 7 are faster than Python 2. > Python 3 is slower than Python 2. Says who? That was certainly true in the 3.2 days, but nowadays, most things that differ seem to be faster in

Re: [Python-Dev] FAT Python (lack of) performance

2016-01-25 Thread Andrew Barnert via Python-Dev
On Jan 25, 2016, at 19:32, INADA Naoki wrote: > >> On Tue, Jan 26, 2016 at 12:02 PM, Andrew Barnert wrote: >> On Jan 25, 2016, at 18:21, INADA Naoki wrote: >> > >> > I'm very interested in it. >> > >> > Ruby 2.2 and PHP 7 are fas

[Python-Dev] Hoping to Find a Mentor

2016-01-26 Thread Truong Nguyen via Python-Dev
Dear Everyone, My name is Truong Nguyen and I like web development. I'm writing hoping to find a mentor (who likes to teach), and opportunity to contribute to the python.org website to gain skills in full stack development. Python Software Foundation interest me because the language is us

Re: [Python-Dev] FAT Python (lack of) performance

2016-01-29 Thread Peter Ludemann via Python-Dev
l > discussion on motives for contributing to open source projects, and > the impact that has on what we can reasonably expect from fellow > contributors. > > Cheers, > Nick. > > -- > Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia > _______

Re: [Python-Dev] Opcode cache in ceval loop

2016-02-01 Thread Andrew Barnert via Python-Dev
; - some macro benchmarks are now 10-20% faster; 2to3 (a real application) is > 7-8% faster; > > - and I have some good insights on the memory footprint. > > ** The purpose of this email is to get a general approval from python-dev, so > that I ca

Re: [Python-Dev] More optimisation ideas

2016-02-01 Thread Andrew Barnert via Python-Dev
On Feb 1, 2016, at 09:59, mike.romb...@comcast.net wrote: > > If the stdlib were to use implicit namespace packages > ( https://www.python.org/dev/peps/pep-0420/ ) and the various > loaders/importers as well, then python could do what I've done with an > embedded python a

Re: [Python-Dev] More optimisation ideas

2016-02-01 Thread Andrew Barnert via Python-Dev
On Feb 1, 2016, at 19:44, Terry Reedy wrote: > >> On 2/1/2016 3:39 PM, Andrew Barnert via Python-Dev wrote: >> >> There are already multiple duplicate questions every month on >> StackOverflow from people asking "how do I find the source to stdlib >> modu

Re: [Python-Dev] Speeding up CPython 5-10%

2016-02-02 Thread Peter Ludemann via Python-Dev
ore a matter of whether you find >> it easier to design the JIT to deal with stack or register code. >> > > It seems like Yury thinks so. He didn't tell use so far. > > > Best, > Sven > > ___ > Python-Dev mailing list > Python-Dev@python.org

Re: [Python-Dev] More optimisation ideas

2016-02-05 Thread Andrew Barnert via Python-Dev
rather than > 'must include' which I understood to mean 'ship with'. First, step back and think of this in common sense terms: If being open source required any Python installation to have the .py source to the .pyc or .zip files in the stdlib, surely it would also requi

Re: [Python-Dev] Improving docs for len() of set

2016-02-08 Thread Andrew Barnert via Python-Dev
et *s* (cardinality of *s*). +{{}} (using the normal von Neumann definitions for 0={} and Succ(n) = n U {n}) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Windows: Remove support of bytes filenames in the os module?

2016-02-08 Thread Andrew Barnert via Python-Dev
On Monday, February 8, 2016 9:11 AM, Alexander Walters wrote: > > On 2/8/2016 12:02, Brett Cannon wrote: >> >> >> If Unicode string don't work in Python 2 then what is Python 2/3 to do >> as a cross-platform solution if we completely remove bytes supp

Re: [Python-Dev] Issue #26204: compiler now emits a SyntaxWarning on constant statement

2016-02-08 Thread Andrew Barnert via Python-Dev
> On Feb 8, 2016, at 11:13, Guido van Rossum wrote: > >> On Mon, Feb 8, 2016 at 9:44 AM, Victor Stinner >> wrote: >> I changed the Python compiler to ignore any kind "constant >> expressions", whereas it only ignored strings and integers before: >>

Re: [Python-Dev] Issue #26204: compiler now emits a SyntaxWarning on constant statement

2016-02-09 Thread Andrew Barnert via Python-Dev
On Tuesday, February 9, 2016 8:14 AM, Michel Desmoulin wrote: > I give regular Python trainings and I see similar errors regularly such as: > > - not returning something; > - using something without putting the result back in a variable. > > However, these are imposs

Re: [Python-Dev] Experiences with Creating PEP 484 Stub Files

2016-02-09 Thread Andrew Barnert via Python-Dev
as instance attributes but "cheese" as a class attribute not usable as an object conforming to the protocol with all three attributes? (Also, does @property count as a class or instance attribute? What about an arbitrary data descriptor? Or a non-data descriptor?) __

Re: [Python-Dev] Windows: Remove support of bytes filenames in theos module?

2016-02-09 Thread Andrew Barnert via Python-Dev
On Feb 9, 2016, at 17:37, Steve Dower wrote: > > Could we perhaps redefine bytes paths on Windows as utf8 and use Unicode > everywhere internally? When you receive bytes from argv, stdin, a text file, a GUI, a named pipe, etc., and then use them as a path, Python treating them as UT

Re: [Python-Dev] Windows: Remove support of bytes filenames in theos module?

2016-02-10 Thread Andrew Barnert via Python-Dev
haven't seen a MacRoman or Shift-JIS filename since they broke the last holdout (the low-level AppleEvent interface) in 10.7--and most of the apps I was using back then don't run on 10.10 without an update. So Python 2 works great on Macs, whether you use bytes or unicode. But that doesn't

Re: [Python-Dev] Windows: Remove support of bytes filenames in theos module?

2016-02-10 Thread Andrew Barnert via Python-Dev
On Wednesday, February 10, 2016 12:47 AM, Victor Stinner wrote: > > 2016-02-10 9:30 GMT+01:00 Paul Moore : >> Whether removing the bytes interface is feasible, given that there's >> then no way that works across Python 2 and 3 of writing code that >> manipulat

Re: [Python-Dev] Windows: Remove support of bytes filenames in theos module?

2016-02-10 Thread Andrew Barnert via Python-Dev
On Wednesday, February 10, 2016 6:50 AM, Stephen J. Turnbull wrote: > Andrew Barnert via Python-Dev writes: > >> That doesn't mean the problem can't be solved. Apple solved their >> equivalent problem, albeit by sacrificing backward compatibility in >> a wa

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-10 Thread Andrew Barnert via Python-Dev
hich can't have leading underscores), but it's also more conservative than this spec in not allowing underscores between e and the sign. I think Perl is the only language that allows them anywhere but in the digits part. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Windows: Remove support of bytes filenames in theos module?

2016-02-10 Thread Andrew Barnert via Python-Dev
On Feb 10, 2016, at 15:11, eryk sun wrote: > > On Wed, Feb 10, 2016 at 2:30 PM, Andrew Barnert via Python-Dev > wrote: >> [^3]: Say you write a program that assumes it will only be run on Shift-JIS >> systems, and you use >> CreateFileA to create a file named

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-10 Thread Andrew Barnert via Python-Dev
On Feb 10, 2016, at 16:21, Steven D'Aprano wrote: > >> On Wed, Feb 10, 2016 at 03:45:48PM -0800, Andrew Barnert via Python-Dev >> wrote: >> On Feb 10, 2016, at 14:20, Georg Brandl wrote: >> >> First, general questions: should the PEP mention the Decim

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-11 Thread Andrew Barnert via Python-Dev
quot;liberal", which the PEP was in favor of, and and it has precedent in more other languages. But, in favor of your version, almost every language uses some variation of "you can put underscores between digits" as the "tutorial-level" explanation and rationale.

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-11 Thread Andrew Barnert via Python-Dev
ed, and still defers to literal syntax and semantics._______ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-11 Thread Andrew Barnert via Python-Dev
ut if people feel strongly one way or the other, the PEP could just give it as a good or a bad example and that would be enough to clarify the intention. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-11 Thread Andrew Barnert via Python-Dev
On Feb 11, 2016, at 10:15, Andrew Barnert via Python-Dev wrote: > > That's a good point: we need style rules for PEP 8. One more point: should the tutorial mention underscores? It looks like the intro docs for a lot of the other languages do. And it would only take one short

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-11 Thread Andrew Barnert via Python-Dev
On Thursday, February 11, 2016 10:35 AM, Jeff Hardy wrote: >On Thu, Feb 11, 2016 at 10:15 AM, Andrew Barnert via Python-Dev > wrote: > >>That's a good point: we need style rules for PEP 8. ... >>It might be simpler to write a "whitelist" than a "bl

Re: [Python-Dev] Time for a change of random number generator?

2016-02-11 Thread Andrew Barnert via Python-Dev
gt; bitstreams" (eg, in a package random.deprecated_generators). I like the random.deprecated_generators idea. ___________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-11 Thread Andrew Barnert via Python-Dev
d social security numbers as integers instead of strings, like 123_45_6789.[^1] Which is why I suggested the style guideline should just say "meaningful grouping of digits", rather than try to predict what counts as "meaningful" for every program. [^1] Of course in Py

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-12 Thread Andrew Barnert via Python-Dev
t... > > SS#... why not integer? Phone#... why not integer? There's a lot of nice > digit-division conventions for phone#s in different parts of the world. I'm the one who brought up the SSN example--and, as I said at the time, I almost certainly wouldn't have done tha

Re: [Python-Dev] Wordcode v2

2016-02-14 Thread Andrew Barnert via Python-Dev
On Feb 14, 2016, at 19:05, Guido van Rossum wrote: > > I think it's probably too soon to discuss on python-dev, but I do > think that something like this could be attempted in 3.6 or (more > likely) 3.7, if it really is faster. > > An unfortunate issue however is that man

<    5   6   7   8   9   10   11   12   13   14   >