Re: [Python-Dev] Why are class dictionaries not accessible?

2016-06-23 Thread Random832
On Wed, Jun 22, 2016, at 11:11, Guido van Rossum wrote: > This is done in order to force all mutations of the class dict to go > through attribute assignments on the class. The latter takes care of > updating the class struct, e.g. if you were to add an `__add__` method > dynamically it would updat

Re: [Python-Dev] PEP 520: Preserving Class Attribute Definition Order (round 5)

2016-06-24 Thread Random832
On Fri, Jun 24, 2016, at 17:52, Eric Snow wrote: > - 2 open questions (__slots__? drop read-only requirement?) It's worth noting that __slots__ itself doesn't have a read-only requirement. It can be a tuple, any iterable of strings, or a single string (which means the object has a single slot).

Re: [Python-Dev] When to use EOFError?

2016-06-27 Thread Random832
On Mon, Jun 27, 2016, at 12:40, Ethan Furman wrote: > On 06/21/2016 01:48 PM, Serhiy Storchaka wrote: > > > There is a design question. If you read file in some format or with some > > protocol, and the data is ended unexpectedly, when to use general > > EOFError exception and when to use format/p

Re: [Python-Dev] PEP 467: next round

2016-07-18 Thread Random832
On Mon, Jul 18, 2016, at 17:34, Alexander Belopolsky wrote: > On Mon, Jul 18, 2016 at 5:01 PM, Jonathan Goble > wrote: > > > full(), despite its use in numpy, is also unintuitive to me (my first > > thought is that it would indicate whether an object has room for more > > entries). > > > > Perhap

Re: [Python-Dev] Should we fix these errors?

2016-07-22 Thread Random832
On Fri, Jul 22, 2016, at 11:35, Victor Stinner wrote: > Oh, the first one is a regression that I introduced in the > implementation of the PEP 475 (retry syscall on EINTR). I don't think > that it can be triggered in practice, because socket handles on > Windows are small numbers, so unlikely to be

Re: [Python-Dev] Convert from unsigned long long to PyLong

2016-07-22 Thread Random832
On Fri, Jul 22, 2016, at 11:50, Eric Snow wrote: > On Fri, Jul 22, 2016 at 3:02 AM, Stefan Ring wrote: > > So to sum this up, you claim that PyLong_FromUnsignedLongLong can > > somehow produce a number larger than the value range of a 64 bit > > number (0x10180). I have a hard time bel

Re: [Python-Dev] stuck issue 26826

2016-08-03 Thread Random832
On Wed, Aug 3, 2016, at 16:32, Marcos Dione wrote: > (it needs to check the availability of the function and the suitability > for the parameters given; copy_file_range() only works on files on the > same filesystem[1]). Hmm... What is the benefit to using copy_file_range over sendfile in this sce

Re: [Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Random832
On Fri, Aug 19, 2016, at 10:13, Chris Angelico wrote: > On my main dev system (Debian Stretch), I've had a single > long-standing test failure - test_site.py, > StartupImportTests.test_startup_imports. It's annoying (partly because > it's such a noisy failure), and doesn't appear to be happening on

Re: [Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Random832
On Fri, Aug 19, 2016, at 18:10, Chris Angelico wrote: > On Sat, Aug 20, 2016 at 8:07 AM, Sjoerd Job Postmus > wrote: > > I'd like to re-iterate my suggestion in case it was missed: split the > > current test in 2 tests: > > > > * Running with `-S` which is for checking that by default the collecti

Re: [Python-Dev] Supported versions of OpenSSL

2016-08-29 Thread Random832
On Mon, Aug 29, 2016, at 04:09, M.-A. Lemburg wrote: > Hmm, that last part would mean that Python 3.7 will no longer compile > on e.g. Ubuntu 14.04 LTS which uses OpenSSL 1.0.1 as default version. > Since 14.04 LTS is supported until 2019, I think it would be better > to only start requiring 1.0.2

Re: [Python-Dev] PEP 528: Change Windows console encoding to UTF-8

2016-09-01 Thread Random832
On Thu, Sep 1, 2016, at 18:28, Steve Dower wrote: > This is a raw (bytes) IO class that requires text to be passed encoded > with utf-8, which will be decoded to utf-16-le and passed to the Windows APIs. > Similarly, bytes read from the class will be provided by the operating > system as utf-16-le

Re: [Python-Dev] What should a good type checker do? (was: Please reject or postpone PEP 526)

2016-09-02 Thread Random832
On Fri, Sep 2, 2016, at 18:49, Koos Zevenhoven wrote: > Then again, (b) instead of that being working code, it might be an > error and spam only takes float. No problem, the type checker will > catch that. There are very few functions that should only take float and not int. > On Fri, Sep 2, 2016

Re: [Python-Dev] PEP 467: last round (?)

2016-09-02 Thread Random832
On Fri, Sep 2, 2016, at 19:44, Ethan Furman wrote: > The problem with only having `bchr` is that it doesn't help with > `bytearray`; What is the use case for bytearray.fromord? Even in the rare case someone needs it, why not bytearray(bchr(...))? ___ Pyt

Re: [Python-Dev] PEP 467: last round (?)

2016-09-03 Thread Random832
On Sat, Sep 3, 2016, at 08:08, Martin Panter wrote: > On 1 September 2016 at 19:36, Ethan Furman wrote: > > Deprecation of current "zero-initialised sequence" behaviour without removal > > > > > > Currently, the ``bytes

Re: [Python-Dev] PEP 467: last round (?)

2016-09-03 Thread Random832
On Sat, Sep 3, 2016, at 18:06, Koos Zevenhoven wrote: > I guess one reason I don't like bchr (nor chrb, really) is that they > look just like a random sequence of letters in builtins, but not > recognizable the way asdf would be. > > I guess I have one last pair of suggestions for the name of this

Re: [Python-Dev] PEP 467: last round (?)

2016-09-04 Thread Random832
On Sun, Sep 4, 2016, at 16:42, Koos Zevenhoven wrote: > On Sun, Sep 4, 2016 at 6:38 PM, Nick Coghlan wrote: > > > > There are two self-consistent sets of names: > > > > Let me add a few. I wonder if this is really used so much that > bytes.chr is too long to type (and you can do bchr = bytes.chr

Re: [Python-Dev] PEP 528: Change Windows console encoding to UTF-8

2016-09-06 Thread Random832
On Tue, Sep 6, 2016, at 06:34, Martin Panter wrote: > Yes, that was basically it. Though I had only thought as far as simple > encodings like ASCII, where one byte corresponds to one character. I > wonder if you really need UTF-8 support. Are the encoding values > currently encountered for Windows

Re: [Python-Dev] (some) C99 added to PEP 7

2016-09-08 Thread Random832
On Thu, Sep 8, 2016, at 12:30, Chris Barker wrote: > That's why I said "based on" -- under the hood, a C type is used, and > IIUC, that type has been "long" for ages. And a long on Windows 64 > (with the MS compiler anyway) is 32 bit, and a long on *nix (with the > gnu compilers, at least) is 64 bi

Re: [Python-Dev] PEP 529: Change Windows filesystem encoding to UTF-8

2016-09-08 Thread Random832
On Thu, Sep 8, 2016, at 13:10, Guido van Rossum wrote: > On Thu, Sep 8, 2016 at 9:57 AM, Brett Cannon wrote: > > Bash on Windows is just Linux, so it isn't affected by any of this. > > I don't know what that sentence means. It means that the so-called "bash" on windows 10 is actually a full Ubun

Re: [Python-Dev] (some) C99 added to PEP 7

2016-09-08 Thread Random832
On Thu, Sep 8, 2016, at 16:01, Chris Barker wrote: > Is there a "long" in there anywhere in the integer implementation? The python 2 long type is the python 3 int type. The python 2 int type is gone. > I don't have py3 running on win64 anywhere right now, but in win64 py2, > that would give you:

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-13 Thread Random832
On Tue, Sep 13, 2016, at 13:24, Nikolaus Rath wrote: > On Sep 11 2016, Terry Reedy wrote: > > Tim Peters investigated and empirically determined that an > > O(n*n) binary insort, as he optimized it on real machines, is faster > > than O(n*logn) sorting for up to around 64 items. > > Out of curios

Re: [Python-Dev] TextIO seek and tell cookies

2016-09-26 Thread Random832
On Mon, Sep 26, 2016, at 05:30, Ben Leslie wrote: > I think the case of JSON or SQL database is even more important though. > > tell/seek can return 129-bit integers (maybe even more? my maths might > be off here). > > The very large integers that can be returned by tell() will break > serializat

Re: [Python-Dev] PyWeakref_GetObject() borrows its reference from... whom?

2016-10-10 Thread Random832
On Mon, Oct 10, 2016, at 14:04, MRAB wrote: > Instead of locking the object, could we keep the GIL, but have it > normally released? > > A thread could then still call a function such as PyWeakref_GetObject() > that returns a borrowed reference, but only if it's holding the GIL. It > would be a

Re: [Python-Dev] List mutation in list_repr?

2016-12-06 Thread Random832
On Tue, Dec 6, 2016, at 05:27, Patrick Westerhoff wrote: > Hey all, > > I just stumbled on the following comment in the C source of the repr > implementation for the list object: > > /* Do repr() on each element. Note that this may mutate the list, >so must refetch the list size on ea

Re: [Python-Dev] Impoverished compare ...

2017-03-09 Thread Random832
On Thu, Mar 9, 2017, at 18:43, Erik wrote: > Hi. > > I'm looking at stuff proposed over on Python-Ideas, and I'd appreciate > some pointers as to the basics of how C-level objects are generally > compared in Python 3. > > The issue is related to the performance of PyObject_RichCompare. I got

Re: [Python-Dev] PEP 538: Coercing the legacy C locale to a UTF-8 based locale

2017-03-13 Thread Random832
On Mon, Mar 13, 2017, at 04:37, INADA Naoki wrote: > But locale coercing works nice on platforms like android. > So how about simplified version of PEP 538? Just adding configure > option for locale coercing > which is disabled by default. No envvar options and no warnings. A configure option ju

Re: [Python-Dev] PEP 538: Coercing the legacy C locale to a UTF-8 based locale

2017-03-14 Thread Random832
On Tue, Mar 14, 2017, at 10:17, Nick Coghlan wrote: > It's not that you *can't* run Python 3 in that kind of environment, and > it's not that there are never any valid reasons to do so. It's that lots > of > things that you'd typically expect to work are going to misbehave (one I > discovered mysel

Re: [Python-Dev] PEP 544: Protocols

2017-03-20 Thread Random832
On Mon, Mar 20, 2017, at 14:07, Brett Cannon wrote: > What is a "trivial body"? I don't know of any such definition anywhere in > Python so this is too loosely defined. You also don't say what happens if > the body isn't trivial. Are tools expected to raise an error? My assumption would be that a

Re: [Python-Dev] Format strings, Unicode, and Py2.7: need clarification

2017-05-18 Thread Random832
On Thu, May 18, 2017, at 01:14, Hobson Lane wrote: > Because `.format()` is a method on an instantiated `str` object in e and > so > must return the same type That it *must* return the same type is overstating the matter. Split returns a list (and, rather like %, the list is of unicode or str obje

Re: [Python-Dev] Need help to fix urllib(.parse) vulnerabilities

2017-07-21 Thread Random832
On Fri, Jul 21, 2017, at 08:43, Giampaolo Rodola' wrote: > It took me a while to understand the security implications of this > FTP-related bug, but I believe I got the gist of it here (I can > elaborate further if it's not clear): > https://github.com/python/cpython/pull/1214#issuecomment-29839316

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

2019-08-14 Thread Random832
On Mon, Aug 12, 2019, at 15:15, Terry Reedy wrote: > Please no more combinations. The presence of both legal and illegal > combinations is already a mild nightmare for processing and testing. > idlelib.colorizer has the following re to detest legal combinations > > stringprefix = r"(?i:r|u|

[Python-Dev] Re: An f-string issue [Was: Re: Re: What to do about invalid escape sequences]

2019-08-14 Thread Random832
On Sat, Aug 10, 2019, at 19:54, Glenn Linderman wrote: > Because of the "invalid escape sequence" and "raw string" discussion, > when looking at the documentation, I also noticed the following > description for f-strings: > > > Escape sequences are decoded like in ordinary string literals (excep

[Python-Dev] Re: Migrate typing in builtin

2019-10-07 Thread Random832
On Mon, Oct 7, 2019, at 10:32, Philippe Prados wrote: > Hello, > > I try to implement a *proof of concept* of Pep-0604 > . > > To do this, the _GenericAlias must be in builtin, because I would like > to update issubclass() and isinstance() to accept Un

[Python-Dev] Re: Migrate typing in builtin

2019-10-07 Thread Random832
On Mon, Oct 7, 2019, at 12:02, Philippe Prados wrote: > Because this PEP propose to accept, for all classes > assert isinstance("", int | str) > assert issubclass(int, int | str) > and add an operator __or__() for type type. > def f(list: List[int | str], param: int | None) -> float | str: > pa

[Python-Dev] Re: Pass the Python thread state to internal C functions

2019-11-14 Thread Random832
On Thu, Nov 14, 2019, at 07:43, Antoine Pitrou wrote: > On Wed, 13 Nov 2019 14:52:32 +0100 > Victor Stinner wrote: > > > > #define _PyRuntimeState_GetThreadState(runtime) \ > > > > ((PyThreadState*)_Py_atomic_load_relaxed(&(runtime)->gilstate.tstate_current)) > > #define _PyThreadState_GET()

[Python-Dev] Re: Pass the Python thread state to internal C functions

2019-11-18 Thread Random832
On Mon, Nov 18, 2019, at 05:26, Antoine Pitrou wrote: > > For the first goal, I don't think this is possible, or desirable. > > Obviously if we remove the GIL somehow then at a minimum we'll need to > > make the global threadstate a thread-local. But I think we'll always > > have to keep it around

[Python-Dev] Re: PEP proposal to limit various aspects of a Python program to one million.

2019-12-03 Thread Random832
On Tue, Dec 3, 2019, at 12:22, Steve Dower wrote: > > * The number of constants in a code object. > > SGTM. Two things... First, for this one in particular, the number of constants in a code object is hard to predict. For example, recently (I want to say 3.7), the number of constants generated

[Python-Dev] PEP 611 - saturating reference counts

2019-12-11 Thread Random832
as an aside in the portion of PEP 611 proposing a limit to the number of classes, the proposal also mentioned reducing the size of the reference count field to achieve part of its object size savings. one of the mechanisms proposed was to implement a "saturating" reference count, though it woul

[Python-Dev] Re: Emit a SyntaxWarning for unhashables literals in hashable dependant literals.

2019-12-12 Thread Random832
On Fri, Dec 13, 2019, at 02:20, mental na via Python-Dev wrote: > Guido van Rossum wrote: > > This is most definitely a language issue, not just a CPython issue -- the > > rules around hashability and (im)mutability are due to the language > > definition, not the whim of an implementer. > > I was

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread Random832
On Thu, Jul 2, 2020, at 05:20, Antoine Pitrou wrote: > We're not talking about posting "your own writing", we're talking about > comments (and presumably documentation) in a collective software > project. There's a need for consistency, however it's > specified and achieved. > > Otherwise why sto

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread Random832
On Thu, Jul 2, 2020, at 18:15, Antoine Pitrou wrote: > On Thu, 02 Jul 2020 17:58:44 -0400 > Random832 wrote: > > Why indeed? > > Because we're talking about PEP 8, and PEP 8 intends to cover the code > style used when writing code in the *Python standard library*. ok,

[Python-Dev] Re: Memory address vs serial number in reprs

2020-07-25 Thread Random832
On Sun, Jul 19, 2020, at 13:02, Guido van Rossum wrote: > That looks expensive, esp. for objects implemented in Python — an extra > dict entry plus a new unique int object. What is the problem you are > trying to solve for these objects specifically? Just that the hex > numbers look distracting

[Python-Dev] Re: Hygenic macros PEP.

2020-09-19 Thread Random832
On Tue, Sep 15, 2020, at 15:22, Mark Shannon wrote: > > Hi all, > > I'd like to propose a new PEP for hygienic macros. To be clear, "hygienic macros" doesn't *just* mean AST-rewriting macros, it also means being able to define variables within the macro expansion that can't possibly collide wi

[Python-Dev] Re: Do we still need a support of non-type objects in issubclass()?

2020-10-06 Thread Random832
On Sat, Oct 3, 2020, at 04:41, Serhiy Storchaka wrote: > Should we continue to support non-type objects with __bases__ in > issubclass()? If no, can we remove their support in 3.10 (it would fix a > crash in issue41909) or after passing a deprecation period? Er, to be clear, contrary to the subjec

<    1   2