Re: [Python-ideas] Efficient debug logging

2017-02-15 Thread Barry Scott
> On 15 Feb 2017, at 02:39, Kyle Lahnakoski wrote: > > > On 2017-02-14 19:51, Abe Dillon wrote: >> The point is that the cost of creating the msg argument can be very high. >> >> At the point that logging decides to skip output it is to late to save >> the

Re: [Python-ideas] Define a method or function attribute outside of a class with the dot operator

2017-02-15 Thread Steven D'Aprano
On Mon, Feb 13, 2017 at 06:14:34PM -0800, David Mertz wrote: > On Mon, Feb 13, 2017 at 5:48 PM, Steven D'Aprano > wrote: > > > # the clean proposed way: > > def instance.method(self): # or MyClass.method > > ... > > > > But I don't think that we can reasonably argue

Re: [Python-ideas] Efficient debug logging

2017-02-15 Thread Barry Scott
On Wednesday, 15 February 2017 22:18:31 GMT Steven D'Aprano wrote: > On Tue, Feb 14, 2017 at 03:51:05PM +, Barry Scott wrote: > > A common pattern I use is to have logging calls for debug and information > > with my applications. The logging calls can be separately enabled and > > disabled. >

Re: [Python-ideas] Python package index: query and rating

2017-02-15 Thread George Fischhof
2017-02-15 12:35 GMT+01:00 Paul Moore : > On 15 February 2017 at 11:07, Steven D'Aprano wrote: > >> I have two ides to improve the package index: > > > > Thank you for your ideas, but I don't think this is the right place for > > suggesting improvements

Re: [Python-ideas] Efficient debug logging

2017-02-15 Thread Barry Scott
On Wednesday, 15 February 2017 22:33:42 GMT Chris Angelico wrote: > On Wed, Feb 15, 2017 at 10:18 PM, Steven D'Aprano wrote: > > Python doesn't have thunks, but there is a relatively heavyweight > > solution for delayed evaluation: wrap the code in a function. > > > >

Re: [Python-ideas] Efficient debug logging

2017-02-15 Thread Chris Angelico
On Wed, Feb 15, 2017 at 10:47 PM, Barry Scott wrote: > __repr__ is interesting however. > > Typically I describe in a string why the value is being logged. That means > that the object is always a string. I cannot recall using debugLog( obj ) > in production. > >

Re: [Python-ideas] Using Python for end user applications

2017-02-15 Thread Steven D'Aprano
On Tue, Feb 07, 2017 at 12:05:49AM -0600, C Anthony Risinger wrote: > How do I redistribute and successfully install Python, dependencies, and an > application with the least possible steps for the end user? For any > platform or persona? For Linux, Unix and Mac, where you can generally expect

Re: [Python-ideas] Efficient debug logging

2017-02-15 Thread Steven D'Aprano
On Tue, Feb 14, 2017 at 03:51:05PM +, Barry Scott wrote: > A common pattern I use is to have logging calls for debug and information > with my applications. > The logging calls can be separately enabled and disabled. [...] > What would be nice is to be able to avoid evaluation the tuple of

Re: [Python-ideas] Efficient debug logging

2017-02-15 Thread Chris Angelico
On Wed, Feb 15, 2017 at 10:18 PM, Steven D'Aprano wrote: > Python doesn't have thunks, but there is a relatively heavyweight > solution for delayed evaluation: wrap the code in a function. > > debugLog( ‘info is %r’, lambda: expensiveFunction() ) > > > and then adjust

Re: [Python-ideas] Python package index: query and rating

2017-02-15 Thread Steven D'Aprano
Hello George, and welcome! On Mon, Feb 13, 2017 at 01:23:22PM +0100, George Fischhof wrote: > Hi There, > > I several times found that it is quite difficult to find an appropriate > library in package index. > > I have two ides to improve the package index: Thank you for your ideas, but I

Re: [Python-ideas] Define a method or function attribute outside of a class with the dot operator

2017-02-15 Thread Steven D'Aprano
On Tue, Feb 14, 2017 at 04:34:09PM -0500, Barry Warsaw wrote: > On Feb 14, 2017, at 12:48 PM, Steven D'Aprano wrote: > > >On Fri, Feb 10, 2017 at 09:05:49PM -0500, Terry Reedy wrote: > >> Saving about 10 keystrokes is close to trivial. > > > >The same argument can be made for @decorator syntax.

Re: [Python-ideas] Efficient debug logging

2017-02-15 Thread Barry Scott
On Tuesday, 14 February 2017 22:00:31 GMT Barry wrote: > > On 14 Feb 2017, at 17:39, Kyle Lahnakoski wrote: > > > > > > Can you wrap the expensive functions in lambdas? And have your logger > > evaluate it, only if required? > > > >> debugLog( ‘info is %r’ % (lambda:

Re: [Python-ideas] Python package index: query and rating

2017-02-15 Thread Paul Moore
On 15 February 2017 at 11:07, Steven D'Aprano wrote: >> I have two ides to improve the package index: > > Thank you for your ideas, but I don't think this is the right place for > suggesting improvements to PyPI. You could try looking through the list > of other Python

Re: [Python-ideas] Python package index: query and rating

2017-02-15 Thread Wes Turner
On Wed, Feb 15, 2017 at 5:35 AM, Paul Moore wrote: > On 15 February 2017 at 11:07, Steven D'Aprano wrote: > >> I have two ides to improve the package index: > > > > Thank you for your ideas, but I don't think this is the right place for > > suggesting

Re: [Python-ideas] Efficient debug logging

2017-02-15 Thread Sven R. Kunze
On 15.02.2017 12:55, Barry Scott wrote: The lazy eval sound like a generator. Exactly my thought. Sven ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct:

[Python-ideas] Passive tracing of function objects (was: Efficient debug logging)

2017-02-15 Thread C Anthony Risinger
On Tue, Feb 14, 2017 at 3:55 PM, Barry wrote: > > > The point is that the cost of creating the msg argument can be very high. > > At the point that logging decides to skip output it is to late to save the > cost of creating the arg tuple. > Awhile back I was playing with

Re: [Python-ideas] Passive tracing of function objects (was: Efficient debug logging)

2017-02-15 Thread C Anthony Risinger
On Wed, Feb 15, 2017 at 10:45 AM, C Anthony Risinger wrote: > On Tue, Feb 14, 2017 at 3:55 PM, Barry wrote: >> >> >> The point is that the cost of creating the msg argument can be very high. >> >> At the point that logging decides to skip output it is to

Re: [Python-ideas] Efficient debug logging

2017-02-15 Thread Abe Dillon
On 15.02.2017, 20:39 Kyle Lahnakoski wrote: > Log "levels" never made sense to me; how can a single dimension be useful > substitute for a number of binary switches? With log "levels", you either > don't have enough logging, or you drown in too much logging (or you manage > a number of loggers,