Re: [Python-Dev] Best practice for documentation for std lib

2013-09-21 Thread Benjamin Peterson
There's not really much to do but maintain them separately. Truncate the docstrings if it makes life easier. 2013/9/21 Steven D'Aprano : > Hi all, > > I have a question about how I should manage documentation for the > statistics module for Python 3.4. At the moment, I have extensive > docstrings

[Python-Dev] Best practice for documentation for std lib

2013-09-21 Thread Steven D'Aprano
Hi all, I have a question about how I should manage documentation for the statistics module for Python 3.4. At the moment, I have extensive docstrings in the module itself. I don't believe anyone has flagged that as "too much information" in a code review, so I'm going to assume that large doc

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread Steven D'Aprano
Guys, this thread is not Python-Dev territory. It should have gone to Python-Ideas. I repeat what I posted two days ago: Proposals for changes to syntax and functionality are normally expected to gather feedback on python-ideas before coming to python-dev for final approval or reject

Re: [Python-Dev] Revert #12085 fix for __del__ attribute error message

2013-09-21 Thread Guido van Rossum
Exceptions in __del__ point to bugs (sometimes in the stdlib) that should be fixed, period. The only reason they do not result in exceptions that are properly bubbled up and catchable is because __del__ is called from a DECREF macro which has no return value. Also, IMO writing to stderr is fair gam

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread Westley Martínez
> -Original Message- > From: Python-Dev [mailto:python-dev-bounces+anikom15=gmail@python.org] On > Behalf Of Ben Finney > Sent: Saturday, September 21, 2013 12:56 PM > To: python-dev@python.org > Subject: Re: [Python-Dev] Use an empty def as a lambda > > Westley Martínez writes: > >

Re: [Python-Dev] Revert #12085 fix for __del__ attribute error message

2013-09-21 Thread Terry Reedy
On 9/21/2013 6:15 PM, R. David Murray wrote: On Sat, 21 Sep 2013 17:16:41 -0400, Terry Reedy wrote: When an AttributeError is raised in a __del__ method, it is caught and ignored, except that it is not completely ignored but is replaced by a warning message sent to stderr. Example: >>> class

Re: [Python-Dev] Revert #12085 fix for __del__ attribute error message

2013-09-21 Thread R. David Murray
On Sat, 21 Sep 2013 17:16:41 -0400, Terry Reedy wrote: > When an AttributeError is raised in a __del__ method, it is caught and > ignored, except that it is not completely ignored but is replaced by a > warning message sent to stderr. Example: > >>> class C(): > def __del__(self): raise A

[Python-Dev] Revert #12085 fix for __del__ attribute error message

2013-09-21 Thread Terry Reedy
When an AttributeError is raised in a __del__ method, it is caught and ignored, except that it is not completely ignored but is replaced by a warning message sent to stderr. Example: >>> class C(): def __del__(self): raise AttributeError >>> c=C() >>> del c Exception AttributeEr

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread Ben Finney
Westley Martínez writes: > My reasoning is that we use class to make classes, lambda to make > lambda functions, and def to make--well not defs--functions, which > doesn't really make sense to me. Your reasoning is flawed. There is no such thing in Python as a “lambda function”. Python has func

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread Westley Martínez
When I say Python 4000, I don't actually mean Python 4.x, I mean the next backwards-incompatible revision to Python (if it comes to pass). My reasoning is that we use class to make classes, lambda to make lambda functions, and def to make--well not defs--functions, which doesn't really make sense t

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread R. David Murray
On Sat, 21 Sep 2013 12:55:20 -0500, Ryan wrote: > "Westley Martínez" wrote: > >'def' is no more ambiguous than 'lambda', and is in fact more > >ambiguous, > >for 'def' doesn't lend itself to anything other than the word define, > >whilst 'lambda' can only mean lambda function. Calling def expli

Re: [Python-Dev] Use an empty def as a lambda

2013-09-21 Thread Ryan
Change def to func? That's the worst idea I've heard yet. Def is already there; why break all existing code just for a word? "Westley Martínez" wrote: >'def' is no more ambiguous than 'lambda', and is in fact more >ambiguous, >for 'def' doesn't lend itself to anything other than the word define

Re: [Python-Dev] dict.setdefault(object, object) instead of "sys.intern()" (was Re: sys.intern should work on bytes)

2013-09-21 Thread Stefan Behnel
Jesus Cea, 20.09.2013 15:46: > On 20/09/13 15:33, Benjamin Peterson wrote: >> Well, the pickler should memoize bytes objects if you have lots of >> the same one in a pickle... > > Only if they are the very same object. Not diferent bytes objects with > the same value. Pickle doesn't do "a==b" but