[Python-Dev] Re: A proposal to modify `None` so that it hashes to a constant

2022-12-02 Thread Rob Cliffe via Python-Dev
that we should hopefully be able to avoid misunderstanding each other. There are probably other places where you could find mentions of this in the docs but I just took a quick look in the Python 3.5 docs (before hash randomisation) to find this mention of dictionary iteration order: https://docs.p

[Python-Dev] Re: A proposal to modify `None` so that it hashes to a constant

2022-12-04 Thread Rob Cliffe via Python-Dev
e. A singleton class can have a hash function that matches identity based equality without using id: any constant hash function will do. -- Oscar ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python

[Python-Dev] Re: A proposal to modify `None` so that it hashes to a constant

2022-12-09 Thread Rob Cliffe via Python-Dev
You're right of course.  Oh well, it *was* a wild idea.😁 Rob Cliffe On 04/12/2 On 04/12/2022 18:16, Chris Angelico wrote: On Mon, 5 Dec 2022 at 05:11, Rob Cliffe via Python-Dev wrote: Wild suggestion: Make None.__hash__ writable. E.g. None.__hash__ = lambda : 0 # Curr

[Python-Dev] Re: A proposal to modify `None` so that it hashes to a constant

2022-12-11 Thread Rob Cliffe via Python-Dev
wrote: On Thu, Dec 01, 2022 at 10:18:49PM +, Rob Cliffe via Python-Dev wrote: Wild suggestion:     Make None.__hash__ writable. E.g.     None.__hash__ = lambda : 0 # Currently raises AttributeError: 'NoneType' object attribute '__hash__' is read-only You would have to

[Python-Dev] Re: PEP 701 – Syntactic formalization of f-strings

2022-12-22 Thread Rob Cliffe via Python-Dev
rammar for f-strings in Python by adding f-strings directly into the Grammar instead of using a two-pass hand-written parser. * This would lift some existing restrictions for f-strings that (we believe) will improve the user experience with f-strings. * Other benefits include:

[Python-Dev] Re: Switching to Discourse

2023-01-26 Thread Alex Krupp via Python-Dev
but others will be mangled or missing text. This means you would still need to maintain the Malman archive as the canonical source of truth. Once fixed, not only would the [Python-Dev] archives be searchable within Discourse, but they should also rank better in search than they do in

[Python-Dev] Re: Feature Suggestion: "repeat" statement in loops

2023-01-27 Thread Jen Kris via Python-Dev
Why would "if not A" also be true when you repeat the current iteration?  What keeps this from becoming an endless loop? Jan 26, 2023, 11:45 by thomasratzk...@outlook.de: > Hi all, > > i would like to suggest the following Python feature. It naturally happens > that on

[Python-Dev] Re: please consider changing --enable-unicode default to ucs4

2023-03-14 Thread Jonathan Benson via Python-Dev
 Sent from my iPhone ___ 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://mail.python.org/archives

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-08 Thread Ivan Pozdeev via Python-Dev
ed with an explanation text. Something like "Cannot assign `i` because this name is already used as a comprehension's loop variable" would clarify what exactly they did wrong. I-am-the-Walrus-lyrics-won’t-help-you-at-all-ly y’rs, -Barry _____

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-08 Thread Rob Cliffe via Python-Dev
s not use SyntaxError for something that's not an error with the syntax. (For reference the error messages are, depending a bit on the Python version, respectively     object of type 'int' has no len()     len() takes exactly one argument (2 given)     len() takes no keyword arguments

[Python-Dev] Re: typing: how to use names in result-tuples?

2019-08-09 Thread Ronald Oussoren via Python-Dev
> On 8 Aug 2019, at 17:42, Christian Tismer wrote: > > On 08.08.19 17:20, Ronald Oussoren via Python-Dev wrote: >> >> >>> On 8 Aug 2019, at 17:12, Christian Tismer >> <mailto:tis...@stackless.com>> wrote: >>> >>> Hi Ronald, &

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Rob Cliffe via Python-Dev
not always obvious. I suggest the only watertight definition of a syntax error is something which raises an exception at compile time.  Obviously this can depend not only on the code, but also on the compiler. Rob Cliffe _______ Python-Dev mailing list -- pyth

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

2019-08-10 Thread Rob Cliffe via Python-Dev
On 06/08/2019 23:41:25, Greg Ewing wrote: 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-co

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

2019-08-10 Thread Rob Cliffe via Python-Dev
directory. [1] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getvolumeinformationw [2] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getvolumenameforvolumemountpointw If they're Windows developers, they ought to be aware that the Windows file syste

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

2019-08-10 Thread Rob Cliffe via Python-Dev
On 10/08/2019 23:30:18, Greg Ewing wrote: Rob Cliffe via Python-Dev wrote: Also, the former is simply more *informative* - it tells the reader that baz is expected to be a directory, not a file. On Windows you can usually tell that from the fact that filenames almost always have an

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

2019-08-15 Thread Rob Cliffe via Python-Dev
_____ I rather like the idea!  (Even though it would add to the proliferation of string types.) Obviously Python can't use # as the special character since that introduces a comment, and a lot of other possibilities are excluded because they would lead to ambiguous syn

[Python-Dev] Re: [Webmaster] Python for Mac OS X Catalina

2019-08-16 Thread Ronald Oussoren via Python-Dev
Hi, As a workaround it is possible to install Python by choosing “open” from the context-menu of in the Finder instead of double clicking on the installer. This is currently necessary because the macOS Catalina has stricter requirements for signing installers, and the Python.org <h

[Python-Dev] Re: [Webmaster] Python for Mac OS X Catalina

2019-08-17 Thread Ana Simion via Python-Dev
Dear All, Thank you very much for your quick responses - I’ve managed to install it via Finder rather than clicking directly on the link in the downloads bar. Many thanks, Ana Simion > On 16 Aug 2019, at 17:50, Ned Deily wrote: > > On Aug 16, 2019, at 06:11, Ronald Oussoren v

[Python-Dev] Missing license for file Modules/ossaudiodev.c

2019-08-19 Thread mihaela olteanu via Python-Dev
statements?Please note that we need this information for our OSS clearance report. Thank you,    Mihaela _______ 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: Missing license for file Modules/ossaudiodev.c

2019-08-19 Thread Ivan Pozdeev via Python-Dev
.h and Modules/_hashopenssl.c in which a copyright notice correctly comes bare and is followed by a license grant compatible with PSFLA. -- Regards, Ivan ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...

[Python-Dev] Re: Missing license for file Modules/ossaudiodev.c

2019-08-20 Thread mihaela olteanu via Python-Dev
Is it possible to contact the contributors and have their explicit agreement or is the LICENSE file at the top level of the repo already covering this scenario? Thank you,Mihaela On Tuesday, August 20, 2019, 12:22:04 AM GMT+3, Ivan Pozdeev via Python-Dev wrote: On 19.08.2019 23:30

[Python-Dev] Re: Missing license for file Modules/ossaudiodev.c

2019-08-21 Thread mihaela olteanu via Python-Dev
That's perfect! Thank you for clarifying this. On Tuesday, August 20, 2019, 5:09:43 PM GMT+2, Guido van Rossum wrote: The LICENSE file at the top is all you need. There is no need to contact inidividual contributors. That's the whole point of how Python licensing is set u

[Python-Dev] Re: PEP 601: discussion-to discuss.python.org

2019-09-07 Thread Rob Cliffe via Python-Dev
where they would break out of the finally. Their use in such a location silently cancels any active exception being raised through the finally, leading to unclear code and possible bugs. Continue is currently not supported in a finally in Python 3.7 (due to implementation issues) and the proposal is

[Python-Dev] Re: python3 -bb and hash collisions

2019-09-10 Thread Ivan Pozdeev via Python-Dev
second operation would also corrupt output. Came across this kind of set in the hyper http library which uses a set to accept certain headers with either str or bytes keys. Does that library support Python 2? If it is true than you have a problem, because u'abc' == b'abc' i

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

2019-09-16 Thread Chris Barker via Python-Dev
fference to anyone's workflow. -CHB On Fri, Sep 13, 2019 at 6:39 PM Sumana Harihareswara wrote: > Hi. I've joined python-dev to participate in this thread (I don't have > email delivery turned on; I'll be checking back via the web). > > Benjamin, I am sorry that I di

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

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

2019-09-18 Thread Chris Barker via Python-Dev
voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.pytho

[Python-Dev] static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-20 Thread Vinay Sajip via Python-Dev
I just ran an analysis of static variable definitions in CPython code, using clang, on Ubuntu and Windows. The results should be available here: https://cpython.red-dove.com/ As I understand it, _Py_IDENTIFIER instances are supposed to hold constant strings that are used in Python - e.g

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-20 Thread Vinay Sajip via Python-Dev
rted internal APIs, but then they're on their own, right?) Regards, Vinay Sajip ___ 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.pytho

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-20 Thread Vinay Sajip via Python-Dev
> > Right, I'm pretty sure that right now Python doesn't have any way to > share symbols between .c files without also exposing them in the C > API. On other C projects I've worked on, the public API is expressed in one set of header files, and internal APIs tha

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-23 Thread Vinay Sajip via Python-Dev
ple. That's my motivation for looking at this area - I spent a bit of time working with Eric at the recent core dev sprint, and wanted to explore the problems in this area. Regards, Vinay _______ Python-Dev mailing list -- python-dev@python.org To unsu

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-23 Thread Vinay Sajip via Python-Dev
ted? If _Py_DecodeLocaleEx is not part of the public API (and the leading underscore suggests so), should it be polluting the symbol space? The comment for PyAPI_FUNC is "Declares a public Python API function and return type". Is this really the case, or has PyAPI_FUNC been coopted

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-23 Thread Vinay Sajip via Python-Dev
s it's still work in progress - which is why I'm asking these questions. Regards, Vinay Sajip _______ 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: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-23 Thread Vinay Sajip via Python-Dev
ef. I will check when I get a chance. Regards, Vinay Sajip _______ 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 archiv

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-23 Thread Vinay Sajip via Python-Dev
Ah - I checked, and it's there OK ... (head scratch) Regards, Vinay Sajip ___ 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.pytho

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-23 Thread Vinay Sajip via Python-Dev
OK - but that's just one I picked at random. There are others like it - what would be the process for deciding which ones need to be made private and moved? Should an issue be raised to track this? Regards, Vinay Sajip ___ Python-Dev mailing

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-23 Thread Vinay Sajip via Python-Dev
Fair enough. Pull request created: https://github.com/python/cpython/pull/16347 Regards, Vinay Sajip ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3

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

2019-09-25 Thread Rob Cliffe via Python-Dev
On 24/09/2019 04:21:45, Benjamin Peterson wrote: On Fri, Sep 13, 2019, at 18:18, Sumana Harihareswara wrote: Hi. I've joined python-dev to participate in this thread (I don't have email delivery turned on; I'll be checking back via the web). sorry :) Benjamin, I am sorr

[Python-Dev] Re: PEP 587 (Python Initialization Configuration) updated to be future proof again

2019-10-06 Thread Ronald Oussoren via Python-Dev
<mailto:ncogh...@gmail.com> a écrit : > > > I don't quite understand the purpose of this change, > > > as there's no > > > stable ABI for applications embedding CPython. > > > Well, I would like to prepare Python to provide a stable ABI for >

[Python-Dev] Re: PEP 587 (Python Initialization Configuration) updated to be future proof again

2019-10-08 Thread David Cuthbert via Python-Dev
rry for the bad timing. I dislike working under pressure. The > discussion on python-dev, the bug tracker and pull requests was really > interesting. > > The issue has been fixed: the whole idea of stable ABI for PyConfig > has been abandoned. If you want to switch to a different vers

[Python-Dev] Python Profilers documentation - typo?

2019-10-08 Thread Rob Cliffe via Python-Dev
uot;thousandths of a second". There is essentially the same thing in the Python 2 docs at     https://docs.python.org/2/library/profile.html viz.     For example, if the timer returns times measured in _thousands_ of seconds, the time unit would be |.001|. Just trying for perfection! Be

[Python-Dev] Re: How official binaries are built?

2019-10-17 Thread Ronald Oussoren via Python-Dev
better than older compilers, but that requires some source changes and testing to ensure that the build still works on older versions of macOS. At this point in time nobody seems to have available time and need to work on this, including myself. Ronald ___

[Python-Dev] Re: EnHackathon 2019 - seeking core dev support

2019-10-20 Thread Lewis Gaul via Python-Dev
business days before (it's often the longest blocker for > first-time contributions): > https://devguide.python.org/pullrequest/#licensing > > Looking forward to your help! > > Brandt > ___ > Python-Dev mailing list -- python-d

[Python-Dev] Re: Helpers for dynamic bytecode generation

2019-10-25 Thread Joe Jevnik via Python-Dev
I think this probably belongs on python-list instead of python-dev because python-dev is for development _of_ python, not _with_ python. To answer your question though, there are a few tools that do this: - https://github.com/vstinner/bytecode - https://github.com/ll/codetransformer I

[Python-Dev] Requesting PR review on locale module

2019-11-17 Thread Cédric Krier via Python-Dev
Hi, Few months ago, I submitted a PR [1] for the bpo [2] about locale.format casting Decimal into float. Has someone some times to finish the review? This change is blocking a bugfix on Tryton [3]. [1] https://github.com/python/cpython/pull/15275 [2] https://bugs.python.org/issue34311 [3] https

[Python-Dev] Re: Travis CI for backports not working.

2019-11-24 Thread Ivan Pozdeev via Python-Dev
On 25.11.2019 1:10, Terry Reedy wrote: Travis passed https://github.com/python/cpython/pull/17366 but a half hour later twice failed https://github.com/python/cpython/pull/17370 This is build logic's fault, `python3.8` is not guaranteed to be present. I believe Configure is finding py

[Python-Dev] Re: Travis CI for backports not working.

2019-11-25 Thread Ivan Pozdeev via Python-Dev
On 25.11.2019 9:50, Terry Reedy wrote: On 11/24/2019 7:30 PM, Ivan Pozdeev via Python-Dev wrote: On 25.11.2019 1:10, Terry Reedy wrote: Travis passed https://github.com/python/cpython/pull/17366 but a half hour later twice failed https://github.com/python/cpython/pull/17370 This is build

[Python-Dev] arm64 python 3.5.6 test case failure - ctypes/test/test_structures.py (test_pass_by_value)

2019-11-28 Thread Peter Morrow via Python-Dev
Hi Folks, Python-dev seemed to be the most appropriate email alias for this, though please do point me somewhere else if this is not appropriate. We are using a custom arm64 based distro built using yocto and as such we are currently using python 3.5.6. We are hitting a failure in a python3

[Python-Dev] Re: arm64 python 3.5.6 test case failure - ctypes/test/test_structures.py (test_pass_by_value)

2019-11-28 Thread Peter Morrow via Python-Dev
d the hint). This is fair - let me do this. Peter. On Thu, Nov 28, 2019 at 7:41 AM Peter Morrow via Python-Dev mailto:python-dev@python.org>> wrote: Hi Folks, Python-dev seemed to be the most appropriate email alias for this, though please do point me somewhere else if this is not appr

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

2019-12-04 Thread David Cuthbert via Python-Dev
gt; million on various aspects of Python programs, such as the lines of code > per module. My main concern about this PEP is it doesn't specify the behavior when a given limit is exceeded. Whether you choose 10 lines or 10 billion lines as the rule, someone annoying (like me) is going t

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

2019-12-12 Thread mental na via Python-Dev
I'm not sure if this is the right place to bring this up, python-ideas seemed like language issues and python-dev seemed like CPython issues. There are several unhashable builtin types present in CPython, as of today the ones I've noticed are: lists, dicts, sets, and bytearrays. Tw

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

2019-12-12 Thread mental na via Python-Dev
it was an implementation issue, but as you've pointed out it's most certainly a language issue; and one that can be detected statically. Now I'd like to suggest that instead of relying on linters and static type checkers to catch these bad patterns. Python shouldn't have allowed

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

2019-12-13 Thread Chris Barker via Python-Dev
topher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ Python-Dev mai

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

2019-12-15 Thread mental na via Python-Dev
Nick Coghlan wrote: > > A tool like > > mypy will catch this for you. > > Perhaps I should raise this as a mypy issue then? > Aye, a typechecker failing to catch this situation would definitely be a > reasonable issue to raise. Roger that, I've raised this on mypy: h

[Python-Dev] Re: Should set objects maintain insertion order too?

2019-12-16 Thread David Cuthbert via Python-Dev
this is bad user code, but I’m all for breaking bad user code in obvious ways sooner rather than subtle ways later, especially in a language like Python. [*] https://arstechnica.com/information-technology/2019/10/chemists-discover-cross-platform-python-scripts-not-s

[Python-Dev] Re: Something wrong with the bug tracker?

2019-12-22 Thread Martin (gzlist) via Python-Dev
vate tab, it makes > no difference. > > Anyone else having problems? > > Cheers, > Mark. > ___ > Python-Dev mailing list -- python-dev@python.org > To unsubscribe send an email to python-dev-le...@python.org > https://mail.pytho

[Python-Dev] Re: Something wrong with the bug tracker?

2019-12-22 Thread Ivan Pozdeev via Python-Dev
On 22.12.2019 18:21, Martin (gzlist) via Python-Dev wrote: Logging in with openid using launchpad just worked for me, so transient or related to google's openid support presumably. I have been unable to log in with google for a long time; had to reset the password to be able to l

[Python-Dev] Re: Why doesn't venv also install python3*-config?

2020-01-08 Thread Ivan Pozdeev via Python-Dev
On 08.01.2020 14:26, Musbur wrote: Hello, I'm experimenting with package development on different versions of Python in different virtualenvs. After running "make" I don't do "make install", but rather I set up virtualenvs by running /path/to/source/python -m v

[Python-Dev] Re: Why doesn't venv also install python3*-config?

2020-01-08 Thread Matt Billenstein via Python-Dev
On Wed, Jan 08, 2020 at 12:26:39PM +0100, Musbur wrote: > I'm experimenting with package development on different versions of Python > in different virtualenvs. After running "make" I don't do "make install", > but rather I set up virtualenvs by running /

[Python-Dev] Re: Requesting PR review on locale module

2020-01-09 Thread Cédric Krier via Python-Dev
wed it up after his requested changes were > > apparently addressed, despite a couple of "pings". > > > > The experts index[1] lists Marc-Andre Lemburg as the expert for the locale > > module, so perhaps he'd be interested in taking a look. > > > >

[Python-Dev] Re: Why doesn't venv also install python3*-config?

2020-01-12 Thread Ivan Pozdeev via Python-Dev
On 12.01.2020 19:20, mus...@posteo.org wrote: Hi guys, after I got the whole list into a lather about the merits of the python-config program, let me rephrase the question: Is there a "canonical" way of automatically finding the correct include files and Python runtime library when

[Python-Dev] Re: Why doesn't venv also install python3*-config?

2020-01-13 Thread Ivan Pozdeev via Python-Dev
On 13.01.2020 16:21, Daniel Haude wrote: Am 12.01.2020 23:39 schrieb Ivan Pozdeev via Python-Dev: Virtualenv does create `python-config` shim in Linux. Python3 doesn't. Definetely. Not on RHEL7 and Debian, that's where I tested it. You are right, I've got it mixed up. Vir

[Python-Dev] PEP 587

2020-01-21 Thread Zak Mabbott via Python-Dev
I am really confused on writing python and what app I need to write it in any tips or any ideas for apps?? ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3

[Python-Dev] Comparing UUID objects to strings: why not?

2020-01-23 Thread Michael Anckaert via Python-Dev
aws in my reasoning. If other people support this change I'd start the work of creating an issue and PR to get this change implemented. -- Michael Anckaert +32 474 066 467 https://www.sinax.be _______ Python-Dev mailing list -- python-dev@python.org T

[Python-Dev] Re: Comparing UUID objects to strings: why not?

2020-01-23 Thread Michael Anckaert via Python-Dev
, and, by proxy, this idea. > ___ > 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://mail.python.org

[Python-Dev] Re: Request to postpone some Python 3.9 incompatible changes to Python 3.10

2020-01-24 Thread Ivan Pozdeev via Python-Dev
iases to ABC classes * Removed fractions.gcd() function (which is similar to math.gcd()) * Remove "U" mode of open(): having to use io.open() just for Python 2 makes the code uglier * Removed old plistlib API: 2.7 doesn't have the new API You had years to fix deprecation warnings in your co

[Python-Dev] Re: Are PyObject_RichCompareBool shortcuts part of Python or just CPython quirks?

2020-01-24 Thread Ivan Pozdeev via Python-Dev
calls PyObject_RichCompareBool() under the covers, for an equality or inequality test, may or may not invoke __eq__ or __ne__, depending on whether the comparands are the same object.  Also any context that inlines these special cases to avoid the overhead of calling PyObject_RichComp

[Python-Dev] Merge bugs.python.org accounts

2020-01-28 Thread Ivan Pozdeev via Python-Dev
Who should I contact on subj? BPO UI doesn't have any contact information. -- Regards, Ivan ___ 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/p

[Python-Dev] pickle.reduce and deconstruct functions

2020-02-08 Thread Andrew Barnert via Python-Dev
here.) The way to get the necessary information isn't fully documented, and neither is the way to interpret it. And I don't think it _should_ be documented, because it changes every so often, and for good reasons; we don't want anyone writing third-party code that relies on thos

[Python-Dev] Re: pickle.reduce and deconstruct functions

2020-02-09 Thread Andrew Barnert via Python-Dev
urn c if issubclass(cls, type): return _deepcopy_atomic Also, all of the private functions that are stored in `_deepcopy_dispatch` would rename their `deepcopy` parameter to `recurse`, and the two that don't have such a parameter would add it. [1]: htt

[Python-Dev] Re: PEP 584: Add Union Operators To dict

2020-02-16 Thread Andrew Barnert via Python-Dev
onstruction call instead of post-hooking it, the cost might be reduced enough to change that calculation. But again, I'm not sure if there is such a way.) ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to

[Python-Dev] Re: Merging PRs without CLA signed

2020-02-23 Thread Ivan Pozdeev via Python-Dev
On 24.02.2020 7:07, Kyle Stanley wrote: For a full list of merged PRs to CPython with a "CLA not signed" label, see the following: https://github.com/python/cpython/pulls?utf8=%E2%9C%93&q=is%3Apr+state%3Amerged+label%3A%22CLA+not+signed%22 Note that if you open a PR, and _

[Python-Dev] Re: Merging PRs without CLA signed

2020-02-24 Thread Ivan Pozdeev via Python-Dev
was an incredibly minimal documentation enhancement: https://github.com/python/cpython/pull/14069. It's not exactly a typo fix, but in retrospect, I'd consider it to be about equally impactful. I can't speak for everyone, but my own motivation was to do something very mildly hel

[Python-Dev] Re: [bpo-22699] Cross-compiling and fixing sysconfig

2020-03-19 Thread Ivan Pozdeev via Python-Dev
Last time I checked, distutils didn't support compilation for anything but the running Python instance, nor was it intended to. Should it? If not, the efforts look misplaced, you should rather use a toolchain that does... On 19.03.2020 23:22, Steve Dower wrote: So over on

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Rob Cliffe via Python-Dev
On 20/03/2020 22:21, Victor Stinner wrote: Motivating examples from the Python standard library The examples below demonstrate how the proposed methods can make code one or more of the following: (...) IMO there are too many examples

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Rob Cliffe via Python-Dev
rely on Cpython's behavior here, consciously or not. Is there some python implementation that would have a problem with the "is" test, if we were being this prescriptive? Honest question. Of course this would open the question of what to do if the suffix is the empty string. B

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Rob Cliffe via Python-Dev
On 21/03/2020 20:16, Ned Batchelder wrote: On 3/21/20 12:51 PM, Rob Cliffe via Python-Dev wrote: On 21/03/2020 16:15, Eric V. Smith wrote: On 3/21/2020 11:20 AM, Ned Batchelder wrote: On 3/20/20 9:34 PM, Cameron Simpson wrote: On 20Mar2020 13:57, Eric Fahlgren wrote: On Fri, Mar 20

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Ivan Pozdeev via Python-Dev
Python-Version: 3.9 Post-History: 30-Aug-2002 Abstract This is a proposal to add two new methods, ``cutprefix`` and ``cutsuffix``, to the APIs of Python's various string objects. In particular, the methods would be added to Unicode ``str`` objects, binary ``bytes`` and ``byte

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Ivan Pozdeev via Python-Dev
tartswith/endswith. If you were to talk about this kind of condition using English instead of Python, you wouldn't say "if x has prefix y", you'd say "if x starts with y". (I doubt any programming language uses hasPrefix or has_prefix for this, making it a strawman.) *Bu

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Ivan Pozdeev via Python-Dev
On 22.03.2020 7:46, Steven D'Aprano wrote: On Sun, Mar 22, 2020 at 06:57:52AM +0300, Ivan Pozdeev via Python-Dev wrote: Does it need to be separate methods? Yes. Overloading a single method to do two dissimilar things is poor design. They are similar. We're removing stuff from

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-22 Thread Rob Cliffe via Python-Dev
On 22/03/2020 22:25, Dennis Sweeney wrote: Here's an updated version. Online: https://www.python.org/dev/peps/pep-0616/ Source: https://raw.githubusercontent.com/python/peps/master/pep-0616.rst Changes: - More complete Python implementation to match what the type checking in

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-23 Thread Rob Cliffe via Python-Dev
Sorry, another niggle re handling an empty affix:  With your Python implementation, 'aba'.cutprefix(('', 'a')) == 'aba' 'aba'.cutsuffix(('', 'a')) == 'ab' This seems surprising. Rob Gadfly Cliffe On 22/03/2020

[Python-Dev] MacOS pkg bundles openssl, but doesn't include a cert bundle?

2020-03-23 Thread Matt Billenstein via Python-Dev
Matt Billenstein m...@vazor.com http://www.vazor.com/ ___ 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

[Python-Dev] Re: MacOS pkg bundles openssl, but doesn't include a cert bundle?

2020-03-23 Thread Matt Billenstein via Python-Dev
Thanks Ned - confirmed that works in 2.7.17 - maybe it was there in 2.7.16 and I just overlooked that messaging in the last step. m On Mon, Mar 23, 2020 at 09:11:09PM -0400, Ned Deily wrote: > On Mar 23, 2020, at 20:30, Matt Billenstein via Python-Dev > wrote: > > Hi, installin

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-25 Thread Ivan Pozdeev via Python-Dev
=>  --> print(socket.AF_UNIX) AddressFamily.AF_UNIX    ==>  socket.AF_UNIX Thoughts? -- ~Ethan~ ___ 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: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-25 Thread Ivan Pozdeev via Python-Dev
On 26.03.2020 2:41, Chris Angelico wrote: On Thu, Mar 26, 2020 at 10:38 AM Ivan Pozdeev via Python-Dev wrote: I'm skeptical about anything that hides an object's "true nature": this is a major landmine in diagnostics because it lies to you about what you are looking at a

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-25 Thread Ivan Pozdeev via Python-Dev
On 26.03.2020 4:10, Chris Angelico wrote: On Thu, Mar 26, 2020 at 12:08 PM Ivan Pozdeev via Python-Dev wrote: On 26.03.2020 2:41, Chris Angelico wrote: On Thu, Mar 26, 2020 at 10:38 AM Ivan Pozdeev via Python-Dev wrote: I'm skeptical about anything that hides an object's &q

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-26 Thread Ivan Pozdeev via Python-Dev
On 26.03.2020 11:59, Serhiy Storchaka wrote: 26.03.20 01:35, Ivan Pozdeev via Python-Dev пише: E. g. in this case, AF_UNIX is a member of some entity called "AddressFamily" -- so I would search the code for "AddressFamily" to see what I'm looking at and what else I

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-27 Thread Ivan Pozdeev via Python-Dev
On 26.03.2020 19:24, Ethan Furman wrote: On 03/25/2020 06:53 PM, Ivan Pozdeev via Python-Dev wrote: A diagnostic is always done by the same algorithm: 1) Identify the exact place in code where the problem manifests itself 2) Examine the state of the program at that moment to find out which if

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-29 Thread Rob Cliffe via Python-Dev
d why they were rejected, seems sufficient. Rob Cliffe ___ 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: [Python-ideas] Re: reversed enumerate

2020-04-01 Thread Andrew Barnert via Python-Dev
t do you get? You presumably don’t even need to look that up or try it out. It would be pretty confusing if it were different without the tuple. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https:

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-02 Thread Matt Billenstein via Python-Dev
e top N packages and run some script over the python files contained therein, but I can't seem to find it atm. m -- Matt Billenstein m...@vazor.com http://www.vazor.com/ _______ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an em

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-02 Thread Matt Billenstein via Python-Dev
ipt > to download the top N packages and run some script over the python files > contained therein, but I can't seem to find it atm. > > > We got that. Check https://github.com/gvanrossum/pegen/tree/master/scripts -- > look at download_pypi_packages.py and test_pypi_pa

[Python-Dev] Re: PEP: Modify the C API to hide implementation details

2020-04-11 Thread Ivan Pozdeev via Python-Dev
On 10.04.2020 20:20, Victor Stinner wrote: Hi, Here is a first draft a PEP which summarize the research work I'm doing on CPython C API since 2017 and the changes that me and others already made since Python 3.7 towards an "opaque" C API. The PEP is also a collaboration with dev

[Python-Dev] Re: PEP: Modify the C API to hide implementation details

2020-04-14 Thread Ronald Oussoren via Python-Dev
runtimes share the same > code base, features implemented in CPython will be available in both > runtimes. > * `Stable ABI`_: Only build a C extension once and use it on multiple > Python runtimes and different versions of the same runtime. > * Better advertise alternative Pyth

[Python-Dev] Re: PEP: Modify the C API to hide implementation details

2020-04-15 Thread Ronald Oussoren via Python-Dev
ssue40170#msg366474 Another issue with making structures opaque is that this makes it at best harder to subclass builtin types in an extension while adding additional data fields to the subclass. This is a similar issue as the fragile base class issue that was fixed in Objective-C 2.0 by

[Python-Dev] Re: Improvement to SimpleNamespace

2020-04-15 Thread Ivan Pozdeev via Python-Dev
First of all, be aware of the limitations of this approach (which will need to be clearly documented if we go this way): * It only allows valid Python identifiers -- while JSON accepts any sequence of Unicode characters for keys (http://www.ecma-international.org/publications/files/ECMA-ST

[Python-Dev] Re: Improvement to SimpleNamespace

2020-04-15 Thread Ivan Pozdeev via Python-Dev
On 16.04.2020 0:34, Glenn Linderman wrote: On 4/15/2020 12:47 PM, Ivan Pozdeev via Python-Dev wrote: When writing a proof-of-concept implementation, however, I bumped into the need to distinguish which of the child objects are containers (thus need to be wrapped as well) and which are the

[Python-Dev] Re: PEP 554 for 3.9 or 3.10?

2020-04-21 Thread Ronald Oussoren via Python-Dev
use >> the new API, which will take years and tons of work -- it's similar to >> the Python 3 transition. Many libraries will never make the jump. > > Again, that is a grand statement that makes things sound much worse > than they really are. I expect very very few exten

[Python-Dev] Re: PEP 554 for 3.9 or 3.10?

2020-04-22 Thread Ronald Oussoren via Python-Dev
supporting sub-interpreters in PyObjC will likely be a lot of work, >> mostly >> due to being able to subclass Objective-C classes from Python. With sub- >> interpreters a Python script in an interpreter could see an Objective-C >> class in >> a different sub-interpret

<    11   12   13   14   15   16   17   18   >