Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Greg Ewing
rError("Invalid int") else: result = computation(i) makes it obvious that control can't fall off the end of the except branch. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] Tangent on class level scoping rules (was Re: PEP 463: Exception-catching expressions)

2014-02-22 Thread Greg Ewing
Chris Angelico wrote: On Sat, Feb 22, 2014 at 10:57 AM, Greg Ewing wrote: I'm still not convinced it would be all *that* difficult. Seems to me it would be semantically equivalent to renaming the inner variable and adding a finally clause to unbind it. Is there something I'm mis

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-03-05 Thread Greg Ewing
ey not being in the dictionary. The actual behaviour is correct, IMO, because it avoids masking bugs, so this could probably be worded better. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsu

Re: [Python-Dev] Reference cycles in Exception.__traceback__

2014-03-06 Thread Greg Ewing
were able to hold a line number. As it was, I had to create an entire fake Frame object filled with mostly dummy values, just to get line numbers printed in the traceback. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org

Re: [Python-Dev] Python 4: don't remove anything, don't break backward compatibility

2014-03-10 Thread Greg Ewing
! The downside is that we'll get endless complaints from jmfauth about the Flexible Version Number Representation. :-( -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] Python 4: don't remove anything, don't break backward compatibility

2014-03-10 Thread Greg Ewing
MRAB wrote: What does "irregardless" mean? It's what people say when they misunderestimate the importance of correct prefix usage in English. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/

Re: [Python-Dev] Confirming status of new modules in 3.4

2014-03-15 Thread Greg Ewing
t oriented implementation" API design model in PEP 8, I don't think I would call this a "procedural" API. To my mind, any API that exposes objects with methods is an object-oriented API, whether it encourages subclassing those objects or not. -- Greg

Re: [Python-Dev] Call for Python Developers for our humanoid Robot NAO

2014-03-18 Thread Greg Ewing
Christian Heimes wrote: Can the NAO bot do The Silly Walk (tm), too? From what I gather, making robots do *non*-silly walks is the hard part. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python

Re: [Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Final, Take 3

2014-03-27 Thread Greg Ewing
argument? That seems sufficient for debugging purposes to me. -- Greg ___ 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] Negative timedelta strings

2014-03-28 Thread Greg Ewing
Alexander Belopolsky wrote: I meant ISO 8601 syntax for "durations" [1]. ISO 8601 doesn't seem to define a representation for negative durations, though, so it wouldn't solve the original problem. -- Greg ___ Python-Dev mai

Re: [Python-Dev] PEP 465: A dedicated infix operator for matrix multiplication

2014-04-07 Thread Greg Ewing
three. A dedicated PyArrayMethods struct can replace some if not all of these allocations. I don't see how. NumPy arrays allocate all three because they override just about every method in existence. Adding another struct isn't going to eliminate the need for the existing ones

Re: [Python-Dev] PEP 465: A dedicated infix operator for matrix multiplication

2014-04-08 Thread Greg Ewing
Victor Stinner wrote: I started to implement the RFC 1924 to have a full support. 3 days later, when my code was working, I saw the date of the RFC... Do you still have the code? It needn't go to waste -- this would make a fine addition to Python's easter egg basket

Re: [Python-Dev] arguments policy: **kwargs.pop()

2014-04-11 Thread Greg Ewing
args would mean explicitly passing them on to the base __init__, further cluttering up the code. -- Greg ___ 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

[Python-Dev] python-3.4.0

2014-04-13 Thread Greg Mildenstein
something I'm doing wrong? Thanks Greg Mildenstein ___ 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] Python "2migr8"

2014-04-14 Thread Greg Ewing
Guido van Rossum wrote: Some quick thoughts: - I'd prefer a name that plays on 2 and 3, not 2 and 8. :-) Python Twee? Or maybe Python Tween, as in "between 2 and 3". -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://

Re: [Python-Dev] Software integrators vs end users (was Re: Language Summit notes)

2014-04-18 Thread Greg Ewing
he word "consume" as though it were a synonym for "use". It's not.) When-I-consume-a-word-said-Humpty-Dumpty-ly, Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] PEP 469: Restoring the iterkeys/values/items() methods

2014-04-19 Thread Greg Ewing
recognise dicts and do the appropriate thing for the Python version concerned. If it doesn't recognise the type, it would fall back to a generic implementation like for k in d: v = d[k]: ... -- Greg ___ Python-Dev mailing list

Re: [Python-Dev] pep8 reasoning

2014-04-24 Thread Greg Ewing
Chris Angelico wrote: add_HTTP_header add_http_header addHTTPHeader addHttpHeader Five... there are FIVE options... convertXMLtoJSON i.e. don't capitalise a part that follows capitalised initials. -- Greg ___ Python-Dev mailing list Pytho

Re: [Python-Dev] Multiple inheritance from builtin (C) types [still] supported in Python3?

2014-04-29 Thread Greg Ewing
guess would be that it wasn't considered worth the effort, if it was considered at all. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/option

Re: [Python-Dev] Returning None from methods that mutate object state

2014-05-20 Thread Greg Ewing
a mutating method than a non-mutating one, so it's less likely you'll make a mistake. -- Greg ___ 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] Internal representation of strings and Micropython

2014-06-04 Thread Greg Ewing
nts (maybe being an int subclass?) allowing them to be used in any existing algorithm that slices strings using ints. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail

Re: [Python-Dev] Internal representation of strings and Micropython

2014-06-04 Thread Greg Ewing
as been pointed out, fitting Python onto a small device is always going to necessitate some compromises. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailma

Re: [Python-Dev] Internal representation of strings and Micropython

2014-06-04 Thread Greg Ewing
ython codepoint indexing via integers. That's true, although most programs would have to go out of their way to tell the difference, especially if StringPosition were a subclass of int. I agree that cacheing indexes would be more transparent, though

Re: [Python-Dev] Internal representation of strings and Micropython

2014-06-04 Thread Greg Ewing
you should really walk each string individually. -- Greg ___ 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] Internal representation of strings and Micropython

2014-06-05 Thread Greg Ewing
the outside world at all. The rationale of internal UTF-8 is that the use of any other encoding internally will be inefficient since those strings will need to be transcoded to UTF-8 before they can be written or printed, No, I think the rationale is that UTF-8 is likely to use less memory t

Re: [Python-Dev] [numpy wishlist] Interpreter support for temporary elision in third-party classes

2014-06-05 Thread Greg Ewing
ry elision. -- Greg ___ 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] [numpy wishlist] Interpreter support for temporary elision in third-party classes

2014-06-05 Thread Greg Ewing
than a type flag. -- Greg ___ 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] Internal representation of strings and Micropython

2014-06-05 Thread Greg Ewing
, Python 3 bytes and Python 2 str, but it's far from clear what you want this type to be like. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/op

Re: [Python-Dev] Internal representation of strings and Micropython

2014-06-06 Thread Greg Ewing
ser's native language. E.g. this document lists a big pile of hex byte values and little or no text that I can see: https://law.resource.org/pub/us/cfr/ibr/005/sae.j1979.2002.pdf -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://

Re: [Python-Dev] [numpy wishlist] Interpreter support for temporary elision in third-party classes

2014-06-06 Thread Greg Ewing
ially being overwritten whether it's okay to overwrite it? I.e. a parameterless method returning a boolean. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.

Re: [Python-Dev] [numpy wishlist] Interpreter support for temporary elision in third-party classes

2014-06-07 Thread Greg Ewing
necessary to do so, after all. This would also make it possible for the inplace operators to have different semantics from temp-elided non-inplace ones if desired. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman

Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-12 Thread Greg Ewing
ways use /bin/sh, NOT the user's current login shell, for this very reason. I would hope that the Python versions of these, and also the new subprocess stuff, do the same. That still leaves differences between Unix and Windows, but explicitly naming the shell

Re: [Python-Dev] Criticism of execfile() removal in Python3

2014-06-14 Thread Greg Ewing
Fabio Zadrozny wrote: Well, I must say that the exec(open().read()) is not really a proper execfile implementation because it may fail because of encoding issues... It's not far off, though -- all it needs is an optional encoding parameter. --

Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-14 Thread Greg Ewing
ich doesn't use PATH. This seems like an unfortunate platform difference to me. It would be better if PATH were searched on both platforms, or better still, make it an option independent of shell=True. -- Greg ___ Python-Dev mailing list Py

Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-15 Thread Greg Ewing
Paul Moore wrote: Huh? CreateProcess uses PATH: Hmm, in that case Microsoft's documentation is lying, or subprocess is doing something itself before passing the command name to CreateProcess. Anyway, looks like there's no problem

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

2018-06-27 Thread Greg Ewing
'd choose to use parentlocal instead of nonlocal with an explicit assignment in the outer scope. Except maybe for the class-scope situation, which seems like an extremely obscure reason to introduce a whole new scoping concept with its own keyword. -- Greg ___

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

2018-06-27 Thread Greg Ewing
about the *scopes* in which those iterators are evaluated, however. Currently the only situation where the scoping makes a difference is a generator expression that isn't immediately used, and you can get a long way into your Python career without ever encountering that

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

2018-06-27 Thread Greg Ewing
new keyword) whose justification is very little more than "it makes explaining comprehension scopes easier". -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscri

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

2018-06-27 Thread Greg Ewing
cular case. Like maybe adding an "as" clause to if-statements: if pattern.match(s) as m: do_something_with(m) -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

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

2018-06-28 Thread Greg Ewing
like [x for i in range(5) letting x = x + 1 given x = 0] -- Greg ___ 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] Help preventing SIGPIPE/SIG_DFL anti-pattern.

2018-06-30 Thread Greg Ewing
silently instead of producing an ugly message. That would remove the source of pain that's leading people to do this. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https:

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

2018-06-30 Thread Greg Ewing
They also provide an opportunity to make the error of not making them the same when they should be, and add the maintenance burden of ensuring they stay the same when changes are made. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.

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

2018-07-03 Thread Greg Ewing
he sense that the others do. So maybe "generator expression" is the best we could have done. -- Greg ___ 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] Naming comprehension syntax [was Re: Informal educator feedback on PEP 572 ...]

2018-07-03 Thread Greg Ewing
first three after you've run the iterators within it, but with a generator expression, you already have a generator before you've run it. That makes it feel different to me. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://

Re: [Python-Dev] PEP 484

2018-07-04 Thread Greg Ewing
just codifies a way of using them to represent types. Also, PEP 484 does specify a way of using comments to indicate types. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Symmetric vs asymmetric symbols (was PEP 572: Do we really need a ":" in ":="?)

2018-07-06 Thread Greg Ewing
from BASIC AFAIK which was geared towards regular users who don't > deal with advanced mathematics.) Criticising something because it comes from BASIC smacks of snobbery. Anyway, it's also used by a number of entirely respectable languages such as Pascal and SQL. And what proportio

Re: [Python-Dev] Call for prudence about PEP-572

2018-07-08 Thread Greg Ewing
t was more or less a matter of "Guido wanted it that way". -- Greg ___ 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] Let's change to C API!

2018-08-22 Thread Greg Ewing
uot;argument clinic on steroids" is actually a pretty good description of Pyrex. -- Greg ___ 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] Change in Python 3's "round" behavior

2018-09-26 Thread Greg Ewing
what users want in most cases I don't think that's common knowledge; seems like citation needed? It's not common enough for me to have heard of it before. (BTW, how do you provide a citation for "common knowledge"?-) -- Greg

Re: [Python-Dev] Change in Python 3's "round" behavior

2018-09-29 Thread Greg Ewing
I don't really get the statistical argument. If you're doing something like calculating an average and care about accuracy, why are you rounding the values before averaging? Why not average first and then round the result if you need to

Re: [Python-Dev] Change in Python 3's "round" behavior

2018-09-30 Thread Greg Ewing
ou're doing. -- Greg ___ 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] Change in Python 3's "round" behavior

2018-09-30 Thread Greg Ewing
nt) you have to care about bias. If I'm paying off a loan, it's what the bank calculates that matters, not what I calculate. And I hope the bank isn't relying on the vagaries of Python floating point arithmetic for its critical financial calculations. -- Greg ___

Re: [Python-Dev] Change in Python 3's "round" behavior

2018-09-30 Thread Greg Ewing
sents a value between 5 and 6 seconds. So if you're fussy about rounding, you might want to round clock readings differently from measurements on a ruler. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listi

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

2018-10-24 Thread Greg Ewing
My take on this is that os.system() is there because it's part of the C stdlib, and Python generally aims to provide wrappers for all of the C stdlib facilities. It's not Python's place to start making value judgements about which things are worthy of being wrapped and which a

Re: [Python-Dev] short-circuiting runtime errors/exceptions in python debugger.

2018-10-29 Thread Greg Ewing
When I have a bug that only happens after hours of run time, I try to find a much shorter test case that reproduces it. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https

Re: [Python-Dev] Signalling NANs

2018-11-11 Thread Greg Ewing
Steven D'Aprano wrote: The Debian box uses an ARM processor, so there's that difference too. FWIW, I tried this on MacOSX 10.6 with an Intel Xeon and it also seems to suppress sNaNs. -- Greg ___ Python-Dev mailing list Python-Dev@python

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

2018-11-18 Thread Greg Ewing
make and model (e.g. a 2007 Toyota Corolla Ascent Sedan) - the object value is a specific car (e.g. "that white Corolla over there with 89000 km on the odometer") A bit confusing, because "that white Corolla over there" is referring to it

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

2018-11-18 Thread Greg Ewing
Chris Angelico wrote: Licence plate numbers do get reused. And they can change, e.g. if you get a personalised plate. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https

Re: [Python-Dev] ctypes: is it intentional that id() is the only way to get the address of an object?

2019-01-18 Thread Greg Ewing
code that does anything with the address of an object other than just pass it around is going to depend heavily on the Python implementation being used, so the idea of an implementation-independent way to deal with object addresses seems problematic. -- Greg ___

Re: [Python-Dev] ctypes: is it intentional that id() is the only way to get the address of an object?

2019-01-18 Thread Greg Ewing
ill exists, after which it can get re-used for a different object. So when an object is flushed from your cache, you would have to chase down all the places its id is being stored and eliminate them. Are you sure you couldn't achieve the same thing more safely using weak refer

Re: [Python-Dev] ctypes: is it intentional that id() is the only way to get the address of an object?

2019-01-18 Thread Greg Ewing
e for the docs to talk about addresses in relation to id() -- it seems to have given some people unrealistic expectations. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] ctypes: is it intentional that id() is the only way to get the address of an object?

2019-01-18 Thread Greg Ewing
an just call it: >>> obj = (1,2,3) >>> obj (1, 2, 3) >>> p = ctypes.py_object(obj) >>> p py_object((1, 2, 3)) >>> p.value (1, 2, 3) >>> p.value is obj True -- Greg ___ Python-Dev mailing list Pyth

Re: [Python-Dev] Add more SyntaxWarnings?

2019-01-30 Thread Greg Ewing
Stefan Behnel wrote: So … are you suggesting to use the webbrowser module inside of the REPL to look up the exception message of the previously printed stack trace in stack overflow when a user types "why()"? "Python is searching for an answer to your questi

Re: [Python-Dev] Register-based VM [Was: Possible performance regression]

2019-02-26 Thread Greg Ewing
f the compiler is smart enough, it can often arrange the evaluation of the parameter expressions so that the results end up in the right registers for making the call. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/lis

Re: [Python-Dev] Register-based VM [Was: Possible performance regression]

2019-02-26 Thread Greg Ewing
Joe Jevnik via Python-Dev wrote: If Python switched to a global stack and global registers we may be able to eliminate a lot of instructions that just shuffle data from the caller's stack to the callee's stack. That would make implementing generators more complicated

Re: [Python-Dev] Register-based VM [Was: Possible performance regression]

2019-02-26 Thread Greg Ewing
Victor Stinner wrote: LOAD_CONST_REG R0, 2 (const#2) LOAD_GLOBAL_REG R1, 'range' (name#0) CALL_FUNCTION_REG4, R1, R1, R0, 'n' Out of curiosity, why is the function being passed twice here? -- Greg ___ Python-Dev

Re: [Python-Dev] Register-based VM [Was: Possible performance regression]

2019-02-26 Thread Greg Ewing
Victor Stinner wrote: Using a different register may require an explicit "CLEAR_REG R1" (decref the reference to the builtin range function) which is less efficient. Maybe the source operand fields of the bytecodes could have a flag indicating whether to clear the register after use

Re: [Python-Dev] Compact ordered set

2019-02-28 Thread Greg Ewing
s kind of an obvious thing to do. You can argue about how far the analogy should be taken, but you can't blame people for noticing the similarity. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/pytho

Re: [Python-Dev] configparser: should optionxform be idempotent?

2019-03-07 Thread Greg Ewing
l the things that non-idempotency could break, it would be easier to simply document that idempotency is assumed. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.pyth

Re: [Python-Dev] configparser: should optionxform be idempotent?

2019-03-07 Thread Greg Ewing
n any case, the word is easy enough to avoid in this case. We could say something like: "The optionxform function transforms option names to a canonical form. If the name is already in canonical form, it should be returned unchanged." -- Greg __

Re: [Python-Dev] Remove tempfile.mktemp()

2019-03-19 Thread Greg Ewing
e other program. -- Greg ___ 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] Remove tempfile.mktemp()

2019-03-20 Thread Greg Ewing
Antoine Pitrou wrote: On Wed, 20 Mar 2019 11:25:53 +1300 Greg Ewing wrote: So use NamedTemporaryFile(delete = False) and close it before passing it to the other program. How is it more secure than using mktemp()? It's not, but it solves the problem someone suggested of another progra

[Python-Dev] Replacement for array.array('u')?

2019-03-22 Thread Greg Ewing
. Why is this being deprecated, instead of keeping it and making it always 32 bits? It seems like useful functionality that can't be easily obtained another way. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/ma

Re: [Python-Dev] Deprecating "instance method" class

2019-04-04 Thread Greg Ewing
Christian Heimes wrote: I couldn't find any current code that uses PyInstanceMethod_New. Let's deprecate the feature and schedule it for removal in 3.10. If it's designed for use by things outside of CPython, how can you be sure nothing is usi

Re: [Python-Dev] checking "errno" for math operaton is safe to determine the error status?

2019-04-11 Thread Greg Ewing
the correct result -1. This sounds like a bug in that platform's implementation of expm1() to me. Which platform is it? -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] No longer enable Py_TRACE_REFS by default in debug build

2019-04-12 Thread Greg Ewing
number of separate features that can be enabled individually? -- Greg ___ 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

Re: [Python-Dev] No longer enable Py_TRACE_REFS by default in debug build

2019-04-12 Thread Greg Ewing
would be harder to pull off for statically allocated objects, although probably not impossible. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/opt

Re: [Python-Dev] PEP 594: update 1

2019-05-23 Thread Greg Ewing
up to 9, or we feel like it, whichever comes first." -- Greg ___ 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] [SPAM?] Re: PEP 558: Defined semantics for locals()

2019-05-27 Thread Greg Ewing
Chris Angelico wrote: Except that it does. After calling locals() a second time, the result of the *first* call will be updated to reflect changes. Yeow. That's *really* unintuitive. There had better be an extremely good reason for this behaviour. --

Re: [Python-Dev] [SPAM?] Re: PEP 558: Defined semantics for locals()

2019-05-28 Thread Greg Ewing
x27;s* happening, but not *why* it was designed that way. Would it really be probihitively expensive to create a fresh dict each time? -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-05-28 Thread Greg Ewing
when tracing. If the change to the behaviour of exec() and eval() is a concern, then perhaps there should be a new localsview() function that returns a mutable view, with locals() redefined as dict(localsview()). -- Greg ___ Python-Dev mailing list P

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-05-28 Thread Greg Ewing
Nick Coghlan wrote: Having a single locals() call de-optimize an entire function would be far from ideal. I don't see what would be so bad about that. The vast majority of functions have no need for locals(). -- Greg ___ Python-Dev mailing

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-05-29 Thread Greg Ewing
the ugliness of maintaining all the fast/locals swapping stuff, not because of any principle that the current behaviour is right or better in any way. Given a locals proxy object, it would be much easier to support the old behaviour (which seems obvious and correct to me) without eval or exec

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-05-30 Thread Greg Ewing
using some of its dynamic features. Removing features entirely just because they *can* interfere with these things goes against the spirit of the language, IMO. -- Greg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listin

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-06-02 Thread Greg Ewing
Armin Rigo wrote: You have the occasional big function that benefits a lot from being JIT-compiled but which contains ``.format(**locals())``. There should be a lot less need for that now that we have f-strings. -- Greg ___ Python-Dev mailing list

[Python-Dev] Re: PEP 581 has been updated with "Downsides of GitHub" section

2019-07-02 Thread Greg Ewing
, and don't also change a bunch of other things to the point that the new version won't work on the same system that the old one did. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@

[Python-Dev] Re: Comparing dict.values()

2019-07-24 Thread Greg Ewing
thon really should slap you on the ear and make you specify exactly what you want. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.p

[Python-Dev] Re: Comparing dict.values()

2019-07-25 Thread Greg Ewing
han having code appear to work while doing something subtly different from what you wanted. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/li

[Python-Dev] Re: Comparing dict.values()

2019-07-26 Thread Greg Ewing
o return one of `None`, `False`, or > `True`? No, it's possible for == to return almost anything (numpy arrays return an array of booleans, for example). It just happens that NotImplemented can't be returned, because it has a special me

[Python-Dev] Re: Fwd: Re: Comparing dict.values()

2019-07-26 Thread Greg Ewing
ready perfectly good ways to express those: set(d1.values()) == set(d2.values()) list(d1.values()) == list(d2.values()) -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://

[Python-Dev] Re: Comparing dict.values()

2019-07-26 Thread Greg Ewing
is the one the programmer intended. And we know what the Zen has to say about guessing. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/pytho

[Python-Dev] Re: Comparing dict.values()

2019-07-26 Thread Greg Ewing
-write that code to be explicit about what is really wanted. There is no three-valued logic involved here. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailm

[Python-Dev] Re: Comparing dict.values()

2019-07-26 Thread Greg Ewing
e algorithm for comparing their values()? -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-06 Thread Greg Ewing
Rob Cliffe via Python-Dev wrote: Sorry, that won't work. Strings are parsed at compile time, open() is executed at run-time. It could check for control characters, which are probably the result of a backslash accident. Maybe even auto-correct them... --

[Python-Dev] Re: Changing Python's string search algorithms

2020-10-18 Thread Greg Ewing
They seem to have a knack for making tricky stuff understandable. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Me

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Greg Ewing
structure -- it was all in the directory entry. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https

[Python-Dev] Re: Speeding up CPython

2020-10-21 Thread Greg Ewing
be one of its strengths. I worry that adding four layers of clever speedup tricks will completely destroy this simplicity, leaving us with something that can no longer be maintained or contributed to by ordinary mortals. -- Greg ___ Python-Dev mailing list

[Python-Dev] Re: fail keyword like there is pass keyword

2020-10-23 Thread Greg Ewing
te the *test* so that it fails. You write a proper test, and it fails initially because you haven't yet written the code that it tests. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-26 Thread Greg Ewing
s kind of weird that just looking at data on the disk can change something about it. Sometimes it's an advantage to *not* have quantum computing! -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-d

[Python-Dev] Re: Thoughts on PEP 634 (Structural Pattern Matching)

2020-10-30 Thread Greg Ewing
r choosing a statement, not an expression? Which is a *much* better way to say what I think you were trying to say. -- Greg ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.py

<    1   2   3   4   5   6   7   8   9   10   >