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

2022-12-01 Thread Oscar Benjamin
On Thu, 1 Dec 2022 at 06:56, Chris Angelico wrote: > > On Thu, 1 Dec 2022 at 17:26, Yoni Lavi wrote: > > > > So it's not like it's even possible to require this generally for all > > objects. > > Well, I mean, in theory you could require that objects whose hash > isn't otherwise defined get give

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

2022-11-30 Thread Oscar Benjamin
On Tue, 29 Nov 2022 at 23:46, Steven D'Aprano wrote: > > On Tue, Nov 29, 2022 at 08:51:09PM -, Yoni Lavi wrote: > > > It does make your argument invalid though, since it's based on this > > assumption that I was asking for a requirement on iteration order > > (e.g. like dict's iteration order

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

2022-11-28 Thread Oscar Benjamin
On Tue, 29 Nov 2022 at 01:33, Steven D'Aprano wrote: > > On Mon, Nov 28, 2022 at 11:13:34PM +0000, Oscar Benjamin wrote: > > On Mon, 28 Nov 2022 at 22:56, Brett Cannon wrote: > > As I understand it, we could make sets ordered, but only at the cost of > space (much mo

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

2022-11-28 Thread Oscar Benjamin
On Mon, 28 Nov 2022 at 22:56, Brett Cannon wrote: > > On Sun, Nov 27, 2022 at 11:36 AM Yoni Lavi wrote: >> >> All it takes is for your program to compute a set somewhere with affected >> keys, and iterate on it - and determinism is lost. > > That's actually by design. Sets are not meant to be de

[Python-Dev] Re: Increase of Spammy PRs and PR reviews

2022-01-30 Thread Oscar Benjamin
On Sun, 30 Jan 2022 at 20:36, Steven D'Aprano wrote: > > On Sun, Jan 30, 2022 at 08:36:43AM -0800, Jelle Zijlstra wrote: > > > Agree, the count of 1.6k open PRs is not a good look for new contributors. > > How does that compare to other comparable open source projects? How it compares is a separa

[Python-Dev] Re: The current state of typing PEPs

2021-12-01 Thread Oscar Benjamin
On Wed, 1 Dec 2021 at 12:12, Sebastian Rittau wrote: > > Am 30.11.21 um 13:39 schrieb Oscar Benjamin: > >> Others have mentioned the pressure on libraries to adopt typing and >> I've certainly noticed this with SymPy. I think type hints could be >> good for Sym

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-11-30 Thread Oscar Benjamin
On Tue, 30 Nov 2021 at 23:37, Guido van Rossum wrote: > > We should definitely push back on zealous new converts to typing who insist > that everything should be annotated. But we should also recognize that even > in their current, far from perfect state, type annotations can provide a lot > of

[Python-Dev] Re: The current state of typing PEPs

2021-11-30 Thread Oscar Benjamin
On Tue, 30 Nov 2021 at 09:23, Paul Moore wrote: > > On Tue, 30 Nov 2021 at 02:52, Steve Dower wrote: > > > > THAT'S the kind of thing that also has been happening with typing, and > > why some of us feel the need to publicly re-state things that are all > > agreed upon within this group, but are

[Python-Dev] Re: The current state of typing PEPs

2021-11-25 Thread Oscar Benjamin
On Thu, 25 Nov 2021 at 15:16, Stephen J. Turnbull wrote: > > Executive summary: > > The typing-suspicious crowd has a valid complaint about PEPs 563 and > 649, but it's not that they weren't warned. > > Christopher Barker writes: > > > Annotations can be, and are, used for other things than "typi

[Python-Dev] Re: Documenting Python versioning and stability expectations

2021-10-16 Thread Oscar Benjamin
On Fri, 15 Oct 2021 at 14:12, Petr Viktorin wrote: > > Most of this is, hopefully, just capturing existing tribal knowledge, but: [snip] > > Micro Versions > -- > > A new micro version marks *bugfix* and *security* releases. > These releases are managed for stability; only fixes for kn

[Python-Dev] Re: IRC #python-dev channel is now on Libera Chat (bye bye Freenode)

2021-05-26 Thread Oscar Benjamin
On Thu, 27 May 2021 at 00:52, Dan Stromberg wrote: > > > On Wed, May 26, 2021 at 4:25 PM Greg Ewing > wrote: >> >> > On Wed, May 26, 2021 at 8:55 AM Ammar Askar > > > wrote: >> > >> > most >> > recently if your topic mentioned libera.chat, the new freenode ow

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-20 Thread Oscar Benjamin
On Thu, 20 May 2021 at 04:58, Terry Reedy wrote: > > On 5/13/2021 4:18 AM, Mark Shannon wrote: > > > If a program does 95% of its work in a C++ library and 5% in Python, it > > can easily spend the majority of its time in Python because CPython is a > > lot slower than C++ (in general). > > I beli

[Python-Dev] Re: In support of PEP 649

2021-04-15 Thread Oscar Benjamin
On Fri, 16 Apr 2021 at 01:13, Guido van Rossum wrote: > > On Thu, Apr 15, 2021 at 16:48 Christopher Barker wrote: >> >> And as I noted in my last post — many folks have not been paying attention >> to the typing discussions because they didn’t realize it concerned them. > > It seems a little dis

[Python-Dev] Re: Request for comments on final version of PEP 653 (Precise Semantics for Pattern Matching)

2021-03-30 Thread Oscar Benjamin
On Tue, 30 Mar 2021 at 17:32, Brandt Bucher wrote: Hi Brandt, > > Which requires the sympy class `Symbol` to "self" match. For `sympy` to > > support this pattern with PEP 634 is possible, but a bit tricky. With this > > PEP it can be implemented very easily. > > Maybe I'm missing something, b

[Python-Dev] Re: Request for comments on final version of PEP 653 (Precise Semantics for Pattern Matching)

2021-03-27 Thread Oscar Benjamin
On Sat, 27 Mar 2021 at 13:40, Mark Shannon wrote: > Hi Mark, Thanks for putting this together. > As the 3.10 beta is not so far away, I've cut down PEP 653 down to the > minimum needed for 3.10. The extensions will have to wait for 3.11. > > The essence of the PEP is now that: > > 1. The semant

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-28 Thread Oscar Benjamin
On Mon, 1 Mar 2021 at 00:13, Eryk Sun wrote: > > On 2/28/21, Oscar Benjamin wrote: > > > > - It is possible to configure a default version (although I think you > > have to do it with an environment variable) > > The py launcher in Windows supports a "py.ini&q

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-28 Thread Oscar Benjamin
On Sun, 28 Feb 2021 at 07:04, Stephen J. Turnbull wrote: > > Jim J. Jewett writes: > > > > which file am I actually running? > > > which interpreter am I actually running? > > > how do I tell the computer to use a different interpreter? > > > > If you need to care about any of these, then the

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-27 Thread Oscar Benjamin
On Sat, 27 Feb 2021 at 11:04, Paul Moore wrote: > > On Sat, 27 Feb 2021 at 01:08, Oscar Benjamin > wrote: > > > > The other point though is that it doesn't need to be like this. If the > > issue was just installing Python and then setting up your PATH then >

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Oscar Benjamin
On Fri, 26 Feb 2021 at 23:06, Jim J. Jewett wrote: > > I think his point is that most of his students (economics or business, rather > than comp sci) will never need to use Perl or C or Java. Python is friendly > enough to be useful, but this is still a major pain point. Thanks Jim, that is th

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Oscar Benjamin
On Fri, 26 Feb 2021 at 09:07, Steven D'Aprano wrote: > > On Fri, Feb 26, 2021 at 11:41:56AM +0900, Stephen J. Turnbull wrote: > > Mike Miller writes: > > > > > "sys-admin" is a bit of an overstatement in my phrasing. The core > > > is that you need to understand how a PATH works and be able to

[Python-Dev] Re: PEP 653: Precise Semantics for Pattern Matching

2021-02-19 Thread Oscar Benjamin
On Fri, 19 Feb 2021 at 15:41, Tobias Kohn wrote: > > Hi Mark, > > Thank you for your proposal to try and have more precise semantics for > pattern matching. Of course, the proposal primarily introduces a new and > extended protocol for pattern matching, upon which the 'semantics' is then > bas

[Python-Dev] Re: PEP 653: Precise Semantics for Pattern Matching

2021-02-19 Thread Oscar Benjamin
On Fri, 19 Feb 2021 at 16:27, Tobias Kohn wrote: > > Quoting Oscar Benjamin : > > > I'm not entirely sure but I think that with PEP 653 you can implement this > > like: > > > > def __deconstruct__(obj): > > if obj.step != 1: > &

[Python-Dev] Re: PEP 653: Precise Semantics for Pattern Matching

2021-02-18 Thread Oscar Benjamin
On Thu, 18 Feb 2021 at 17:35, Brandt Bucher wrote: > > Thanks for taking the time to work on this, Mark. Yes, thanks Mark. I'm not sure I've fully understood the PEP yet but I can see some parts that I definitely like. > I fear this is at the expense of most simple classes, which currently "just

[Python-Dev] Re: Concerns about PEP 634

2021-02-07 Thread Oscar Benjamin
On Sat, 6 Feb 2021 at 19:54, Daniel Moisset wrote: > > Hi Mark, > > I think some of these issues have already been raised and replied (even if no > agreement has been reached). but this is a good summary, so let me reply with > a summary of responses for this. > > On Sat, 6 Feb 2021 at 15:51, Ma

[Python-Dev] Re: [python-committers] Performance benchmarks for 3.9

2020-10-14 Thread Oscar Benjamin
On Wed, 14 Oct 2020 at 19:12, Ivan Pozdeev via Python-Dev wrote: > > > On 14.10.2020 17:04, M.-A. Lemburg wrote: > > On 14.10.2020 16:00, Pablo Galindo Salgado wrote: > >>> Would it be possible to get the data for older runs back, so that > >> it's easier to find the changes which caused the slo

[Python-Dev] Re: PEP 622 and variadic positional-only args

2020-07-16 Thread Oscar Benjamin
On Thu, 16 Jul 2020 at 02:09, Guido van Rossum wrote: > > On Wed, Jul 15, 2020 at 4:41 PM Oscar Benjamin > wrote: >> >> I've taken a look through PEP 622 and I've been thinking about how it >> could be used with sympy. >> >> In principle case/m

[Python-Dev] PEP 622 and variadic positional-only args

2020-07-15 Thread Oscar Benjamin
I've taken a look through PEP 622 and I've been thinking about how it could be used with sympy. In principle case/match and destructuring should be useful for sympy because sympy has a class Basic which defines a common structure for ~1000 subclasses. There are a lot of places where it is necessar

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

2019-12-09 Thread Oscar Benjamin
On Tue, 10 Dec 2019 at 00:00, Steven D'Aprano wrote: > > On Sat, Dec 07, 2019 at 07:37:58PM +0000, Oscar Benjamin wrote: > > > I recently hit on a situation that created a one million line code file: > > https://github.com/pytest-dev/pytest/issues/4406#issuecomment-4396

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

2019-12-09 Thread Oscar Benjamin
On Mon, 9 Dec 2019 at 14:10, Mark Shannon wrote: > On 07/12/2019 7:37 pm, Oscar Benjamin wrote: > > On Sat, 7 Dec 2019 at 06:29, Steven D'Aprano wrote: > >> > >> A million seems reasonable for lines of source code, if we're prepared > >> to tell peop

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

2019-12-07 Thread Oscar Benjamin
On Sat, 7 Dec 2019 at 06:29, Steven D'Aprano wrote: > > A million seems reasonable for lines of source code, if we're prepared > to tell people using machine generated code to split their humongous .py > files into multiple scripts. A small imposition on a small subset of > Python users, for the b

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

2019-12-04 Thread Oscar Benjamin
On Wed, 4 Dec 2019 at 05:41, Chris Angelico wrote: > > On Wed, Dec 4, 2019 at 3:16 PM Steven D'Aprano wrote: > > > > On Wed, Dec 04, 2019 at 01:47:53PM +1100, Chris Angelico wrote: > > > > > Integer sizes are a classic example of this. Is it acceptable to limit > > > your integers to 2^16? 2^32?

Re: [Python-Dev] Python in next Windows 10 update

2019-05-22 Thread Oscar Benjamin
On Tue, 21 May 2019 at 21:32, Steve Dower wrote: > > In the next Windows 10 update that starts rolling out today, we > (Microsoft) have added "python.exe" and "python3.exe" commands that are > installed on PATH *by default* and will open the Microsoft Store at the > page where we (Python core team

Re: [Python-Dev] Standard library vs Standard distribution?

2018-11-29 Thread Oscar Benjamin
On Fri, 30 Nov 2018 at 00:17, Steven D'Aprano wrote: > > On Thu, Nov 29, 2018 at 01:30:28PM -0800, Nathaniel Smith wrote: > > [...] > > > > https://anaconda.com/ > > > > https://www.activestate.com/products/activepython/ > > > > http://winpython.github.io/ > > > > http://python-xy.github.io/ > > >

Re: [Python-Dev] PEP 525, third round, better finalization

2016-09-03 Thread Oscar Benjamin
On 3 September 2016 at 16:42, Nick Coghlan wrote: > On 2 September 2016 at 19:13, Nathaniel Smith wrote: >> This works OK on CPython because the reference-counting gc will call >> handle.__del__() at the end of the scope (so on CPython it's at level >> 2), but it famously causes huge problems whe

Re: [Python-Dev] Adding NewType() to PEP 484

2016-05-29 Thread Oscar Benjamin
On 28 May 2016 00:03, "Guido van Rossum" wrote: > > Also -- the most important thing. :-) What to call these things? We're > pretty much settled on the semantics and how to create them (A = > NewType('A', int)) but what should we call types like A when we're > talking about them? "New types" sound

Re: [Python-Dev] Updated PEP 509

2016-04-18 Thread Oscar Benjamin
On 18 April 2016 at 12:46, Jim J. Jewett wrote: >> >> * I removed the dict[key]=value; dict[key]=value. It's really a >> micro-optimization. I also fear that Raymond will complain because it >> adds an if in the hot code of dict, and the dict type is very >> important for Python performance. > > T

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

2016-04-15 Thread Oscar Benjamin
On 15 April 2016 at 18:54, Jim J. Jewett wrote: > > [2A] Do you want to promise that replacing a value with a > non-identical object *will* trigger a version_tag update *even* > if the objects are equal? > > I would vote no, but I realize backwards-compatibility may create > such a promise implici

Re: [Python-Dev] Challenge: Please break this! (a.k.a restricted mode revisited)

2016-04-10 Thread Oscar Benjamin
On 10 Apr 2016 22:55, "Jon Ribbens" wrote: > > On Mon, Apr 11, 2016 at 12:07:48AM +0300, Serhiy Storchaka wrote: > > On 10.04.16 19:51, Jon Ribbens wrote: > > >On Sun, Apr 10, 2016 at 02:51:23PM +1000, Nick Coghlan wrote: > > >>On 9 April 2016 at 22:43, Victor Stinner wrote: > > >>>See pysandbox

Re: [Python-Dev] More optimisation ideas

2016-01-30 Thread Oscar Benjamin
On 30 January 2016 at 03:48, Steve Dower wrote: > > It doesn't currently end up on disk. Some tables are partially or completely > stored on disk as Python source code (some are partially generated from > simple rules), but others are generated by inverting those. That process > takes time that co

Re: [Python-Dev] PEP 0484 - the Numeric Tower

2015-10-14 Thread Oscar Benjamin
On 14 Oct 2015 23:06, "Laura Creighton" wrote: > > In a message of Wed, 14 Oct 2015 21:21:30 -, Oscar Benjamin writes: > >Generally if it's possible to interchange floats and decimals in your code > >then there's probably no need for decimals in the firs

Re: [Python-Dev] PEP 0484 - the Numeric Tower

2015-10-14 Thread Oscar Benjamin
On Wed, 14 Oct 2015 21:57 Laura Creighton wrote: In a message of Wed, 14 Oct 2015 08:38:43 -0700, Guido van Rossum writes: >Perhaps you could solve this with type variables. Here's a little >demonstration program: >``` >from decimal import Decimal >from typing import TypeVar >F = TypeVar('F', flo

Re: [Python-Dev] VS 2010 compiler

2015-09-29 Thread Oscar Benjamin
On Tue, 29 Sep 2015 17:20 Steve Dower wrote: On 29Sep2015 0820, Chris Barker wrote: > OK -- I'm going to get off my soap box now -- time to actually suggest > doc patches Just bear in mind that you're suggesting patches for Python 3.3 and 3.4, which means that 3.4.4 is the only real chance t

Re: [Python-Dev] Building Extensions for Python 3.5 on Windows

2015-09-01 Thread Oscar Benjamin
On 26 August 2015 at 17:14, Steve Dower wrote: >> On 8/25/2015 2:17 PM, Steve Dower wrote: >>> >>> I've written up a long technical blog post about the compiler and CRT >>> changes in Python 3.5, which will be of interest to those who build and >>> distribute native extensions for Windows. >>> >>>

Re: [Python-Dev] PEP 492: What is the real goal?

2015-05-06 Thread Oscar Benjamin
On 5 May 2015 at 17:48, Yury Selivanov wrote: > > I've updated the PEP with some fixes of the terminology: > https://hg.python.org/peps/rev/f156b272f860 Yes that looks better. > I still think that 'coroutine functions' and 'coroutines' > is a better pair than 'async functions' and 'coroutines'.

Re: [Python-Dev] PEP 492: What is the real goal?

2015-05-05 Thread Oscar Benjamin
On 30 April 2015 at 09:50, Arnaud Delobelle wrote: >> >> I'm flexible about how we name 'async def' functions. I like >> to call them "coroutines", because that's what they are, and >> that's how asyncio calls them. It's also convenient to use >> 'coroutine-object' to explain what is the result

Re: [Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-18 Thread Oscar Benjamin
On 18 February 2014 15:53, Terry Reedy wrote: > On 2/18/2014 2:35 AM, Greg Ewing wrote: > >>results = sorted(invoices, key=attrgetter('duedate'), none='first') > > I think this is the best idea on the thread. As a pure enhancement, it could > be added in 3.5. The only tricky part of the implem

Re: [Python-Dev] PEP 461 updates

2014-01-19 Thread Oscar Benjamin
On 19 January 2014 06:19, Nick Coghlan wrote: > > While I agree it's not relevant to the PEP 460/461 discussions, so > long as numpy.loadtxt is explicitly documented as only working with > latin-1 encoded files (it currently isn't), there's no problem. Actually there is problem. If it explicitly

Re: [Python-Dev] PEP 461 updates

2014-01-18 Thread Oscar Benjamin
On 17 January 2014 21:37, Chris Barker wrote: > > For the record, we've got a pretty good thread (not this good, though!) over > on the numpy list about how to untangle the mess that has resulted from > porting text-file-parsing code to py3 (and the underlying issue with the 'S' > data type in num

Re: [Python-Dev] PEP 384 (stable api) question

2013-11-07 Thread Oscar Benjamin
On 7 November 2013 12:44, Thomas Heller wrote: > PEP 384 describes the stable Python api, available when > Py_LIMITED_API is defined. > > However, there are some (small) changes in the function prototypes > available, one example is (in Python 3.3): > PyObject* PyObject_CallFunction(PyObject *cal

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Oscar Benjamin
On 17 October 2013 20:01, Guido van Rossum wrote: > On Thu, Oct 17, 2013 at 11:55 AM, Oscar Benjamin > wrote: >> >> On 17 October 2013 19:40, Xavier Morel wrote: >> > I think there's already a significant split between context managers >> > which handl

Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Oscar Benjamin
On 17 October 2013 19:40, Xavier Morel wrote: > I think there's already a significant split between context managers > which handle the lifecycle of a local resource (file, transaction) and > those which purport to locally alter global-ish state (cwd, > decimal.localcontext, logging.captureWarning

Re: [Python-Dev] Change PEP 399 import recommendation

2013-10-13 Thread Oscar Benjamin
On 12 October 2013 17:55, Christian Heimes wrote: > Am 12.10.2013 17:37, schrieb Nick Coghlan: >> I think the default recommendation in PEP 399 still makes sense - 2 >> modules are easy to manage than three and the idiom allows for easy >> partial replacement. > > We could ues yet another approach

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-17 Thread Oscar Benjamin
On 17 September 2013 22:21, Guido van Rossum wrote: > Congrats, I've accepted the PEP. Nice work! Please work with the reviewers > on the issue on the code. Good work, Steven! ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mai

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-16 Thread Oscar Benjamin
On 16 September 2013 16:42, Guido van Rossum wrote: > I'm ready to accept this PEP. Because I haven't read this entire thread (and > 60 messages about random diversions is really too much to try and catch up > on) I'll give people 24 hours to remind me of outstanding rejections. > > I also haven't

Re: [Python-Dev] Add a "transformdict" to collections

2013-09-10 Thread Oscar Benjamin
On 10 September 2013 10:28, Antoine Pitrou wrote: > On the tracker issue, it seems everyone agreed on the principle. There > is some bikeshedding left to do, though. So here are the reasonable > naming proposals so far: > > - transformkeydict > - coercekeydict > - transformdict > - coercedict > >

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Oscar Benjamin
On 9 September 2013 12:56, Nick Coghlan wrote: >> Alternatively, I thought there was discussion a long time ago about >> getting numpy's >> (or even further back, numeric's?) array type into the core. Python >> has an array type >> which I don't think gets a lot of use (or love). Might it be >> wo

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Oscar Benjamin
On 9 September 2013 04:16, Guido van Rossum wrote: > > Yeah, so this and Steven's review of various other APIs suggests that the > field of statistics hasn't really reached the object-oriented age (or > perhaps the OO view isn't suitable for the field), and people really think > of their data as a

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-09 Thread Oscar Benjamin
On 9 September 2013 09:02, Serhiy Storchaka wrote: > 08.09.13 20:52, Guido van Rossum написав(ла): > >> Well, to me zip(*x) is unnatural, and it's inefficient when the arrays are >> long. > > Perhaps we need zip.from_iterable()? I would prefer it if chain.from_iterable were named something like f

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Oscar Benjamin
On 8 September 2013 18:32, Guido van Rossum wrote: > Going over the open issues: > > - Parallel arrays or arrays of tuples? I think the API should require > an array of tuples. It is trivial to zip up parallel arrays to the > required format, while if you have an array of tuples, extracting the >

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-16 Thread Oscar Benjamin
On Aug 16, 2013 11:05 AM, "Steven D'Aprano" wrote: > > I'll provide two functions: mode, which returns the single value with the highest frequency, or raises; and a second function, which collates the data into a sorted (value, frequency) list. Bike-shedding on the name of this second function is

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-16 Thread Oscar Benjamin
On 15 August 2013 14:08, Steven D'Aprano wrote: > > - The API doesn't really feel very Pythonic to me. For example, we write: > > mystring.rjust(width) > dict.items() > > rather than mystring.justify(width, "right") or dict.iterate("items"). So I > think individual methods is a better API, and one

Re: [Python-Dev] Clean way in python to test for None, empty, scalar, and list/ndarray? A prayer to the gods of Python

2013-06-15 Thread Oscar Benjamin
Your questions/suggestions are off-topic for this list. This belongs on python-ideas. On 14 June 2013 20:12, Martin Schultz wrote: > > 2. Testing for empty lists or empty ndarrays: > 4. Finding the number of elements in an object: > 6. Detecting None values in a list: Each of the problems above

Re: [Python-Dev] Enumeration items: `type(EnumClass.item) is EnumClass` ?

2013-04-29 Thread Oscar Benjamin
On 29 April 2013 20:04, Guido van Rossum wrote: > On Mon, Apr 29, 2013 at 11:34 AM, Larry Hastings wrote: >> What's the problem with overriding the isinstance checks? You mention it >> but seem to assume it's a bad idea. That seems to me like it'd adequately >> solve that problem with an accept

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-04 Thread Oscar Benjamin
On 4 April 2013 10:39, Hrvoje Niksic wrote: > >> On Wed, Apr 3, 2013 at 6:47 AM, Hrvoje Niksic >> wrote: >>> >>> It seems like a good feature that an __int__ implementation can choose to >>> return an int subclass with additional (and optional) information. After >>> all, int subclass instances s

Re: [Python-Dev] Interested in GSoC for biopython

2013-03-22 Thread Oscar Benjamin
On 22 March 2013 21:34, 阮铮 wrote: > Hi, > > I'm Zheng from the University of Georgia. I heard about the GSoC several > weeks before and found biopython also involved in the peoject. I plan to > apply for the GSoC 2013, hoping to make some contributions this summer. [SNIP] This mailing list is for

Re: [Python-Dev] why do we allow this syntax?

2013-02-08 Thread Oscar Benjamin
On 8 February 2013 16:10, Benjamin Peterson wrote: > 2013/2/8 Chris Withers : >> On 08/02/2013 15:42, Benjamin Peterson wrote: >>> >>> 2013/2/8 Chris Withers: Hi All, Just had a bit of an embarrassing incident in some code where I did: sometotal =+ somevalue >>> >>> >

Re: [Python-Dev] why do we allow this syntax?

2013-02-08 Thread Oscar Benjamin
On 8 February 2013 15:39, Chris Withers wrote: > Hi All, > > Just had a bit of an embarrassing incident in some code where I did: > > sometotal =+ somevalue > > I'm curious why this syntax is allowed? I'm sure there are good reasons, but > thought I'd ask... Because '+' can represent an unary pre

Re: [Python-Dev] operator.attrgetter(attr[, args...]) etc.

2012-11-21 Thread Oscar Benjamin
On 21 November 2012 03:57, Leo wrote: > Sorry the python issue tracker seems broken (I cannot log in). So I am > posting it here. > > In the doc: > > operator.attrgetter(attr[, args...]) > operator.itemgetter(item[, args...]) > operator.methodcaller(name[, args...]) > > The signatures of the

Re: [Python-Dev] Why not using the hash when comparing strings?

2012-10-19 Thread Oscar Benjamin
On 19 October 2012 11:02, Duncan Booth wrote: > Hrvoje Niksic wrote: > >> On 10/19/2012 03:22 AM, Benjamin Peterson wrote: >>> It would be interesting to see how common it is for strings which have >>> their hash computed to be compared. >> >> Since all identifier-like strings mentioned in Python

Re: [Python-Dev] TypeError: f() missing 1 required positional argument: 'x'

2012-09-20 Thread Oscar Benjamin
On 20 September 2012 16:14, Benjamin Peterson wrote: > 2012/9/20 Mark Dickinson : > > And excepting optional ones, too, right? E.g., the c in > > > > def foo(a, b, c=1, *args, d): > > pass > > > > can be passed to by position, but isn't "positional". > > Why not? > > >>> def f(a, b,

Re: [Python-Dev] 2to3 porting HOWTO: setup.py question

2012-07-24 Thread Oscar Benjamin
On Jul 24, 2012 10:32 AM, "Terry Reedy" wrote: > > On 7/24/2012 12:44 AM, anatoly techtonik wrote: > >> Python 3 check explicitly tells the reader that 2to3 should only be >> used in Python 3. Otherwise everybody need to guess when this *_2to3 >> tools are triggered. As for me, I see no technical

Re: [Python-Dev] 2to3 porting HOWTO: setup.py question

2012-07-23 Thread Oscar Benjamin
On 23 July 2012 23:27, Éric Araujo wrote: > On 22/07/2012 15:57, R. David Murray wrote: > >> I'm not familiar with distutils, really, so you could be right about >> what it is important to test. I was commenting based on the code >> snippet presented, which just deciding which "build" object to

Re: [Python-Dev] 2to3 porting HOWTO: setup.py question

2012-07-22 Thread Oscar Benjamin
o the second copy I sent to python-dev wasn't posted. > > On Sun, 22 Jul 2012 20:22:50 +0100, Oscar Benjamin > wrote: > > On 22 July 2012 14:08, R. David Murray wrote: > > > > > On Sun, 22 Jul 2012 11:21:38 +0300, anatoly techtonik < > techto...@gmail.

[Python-Dev] 2to3 porting HOWTO: setup.py question

2012-07-22 Thread Oscar Benjamin
On 22 July 2012 14:08, R. David Murray wrote: > On Sun, 22 Jul 2012 11:21:38 +0300, anatoly techtonik > wrote: > > http://docs.python.org/py3k/howto/pyporting.html#during-installation > > > > What's the point in making implicit Python 3 check here: > > try: # Python 3 > > from distutils.comma

Re: [Python-Dev] Status of packaging in 3.3

2012-06-21 Thread Oscar Benjamin
On 21 June 2012 12:48, Chris McDonough wrote: > On 06/21/2012 04:45 AM, Nick Coghlan wrote: > >> On Thu, Jun 21, 2012 at 2:44 PM, Chris McDonough >> wrote: >> >>> All of these are really pretty minor issues compared with the main >>> benefit >>> of not needing to ship everything with everything