Re: why does list's .remove() does not return an object?

2018-05-17 Thread David Stanek
y want to be able to do some sort of method chaining like: the_list.remove(x).remove(y) Although the clarifying example was contrived and confusing. A more concrete example would be greatly appreciated. -- david stanek web: https://dstanek.com twitter: https://twitter.com/dstanek -- https://mail.python.org/mailman/listinfo/python-list

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread David Stanek
a lot of new stuff. -- david stanek web: https://dstanek.com twitter: https://twitter.com/dstanek -- https://mail.python.org/mailman/listinfo/python-list

Re: Application and package of the same name

2017-10-21 Thread David Stanek
they get an AttributeError on requests.get(). -- david stanek web: https://dstanek.com twitter: https://twitter.com/dstanek -- https://mail.python.org/mailman/listinfo/python-list

[issue2445] Use The CygwinCCompiler Under Cygwin

2016-08-30 Thread David Stanek
Changes by David Stanek <dsta...@dstanek.com>: -- nosy: -dstanek ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue2445> ___ __

[issue900092] hotshot.stats.load fails with AssertionError

2014-03-19 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue900092 ___ ___ Python-bugs-list

Re: Inconsistent SMTP/Gmail connection drop

2011-08-03 Thread David Stanek
On Wed, Aug 3, 2011 at 5:46 PM, Astley Le Jasper astley.lejas...@gmail.comwrote: Any ideas? Is it possible that the first email is sent before the network connection has been properly established? -- David blog: http://www.traceback.org twitter: http://twitter.com/dstanek www:

[issue8036] Interpreter crashes on invalid arg to spawnl on Windows

2011-01-26 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: Should this just be resolved as a won't fix? -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8036

[issue6584] gzip module has no custom exception

2011-01-26 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6584 ___ ___ Python-bugs-list mailing

[issue8025] TypeError: string argument expected, got 'str'

2011-01-26 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8025 ___ ___ Python-bugs-list mailing

[issue7659] Attribute assignment on object() instances raises wrong exception

2011-01-26 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7659 ___ ___ Python-bugs-list mailing

[issue4492] httplib code thinks it closes connection, but does not

2011-01-26 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4492 ___ ___ Python-bugs-list mailing

[issue2007] cookielib lacks FileCookieJar class for Internet Explorer

2011-01-26 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2007 ___ ___ Python-bugs-list mailing

[issue9233] json.load failure when C optimizations aren't built

2011-01-26 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9233 ___ ___ Python-bugs-list mailing

[issue3849] FUD in documentation for urllib.urlopen()

2011-01-26 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3849 ___ ___ Python-bugs-list mailing

[issue5097] asyncore.dispatcher_with_send undocumented

2011-01-26 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5097 ___ ___ Python-bugs-list mailing

[issue8743] set() operators don't work with collections.Set instances

2011-01-26 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8743 ___ ___ Python-bugs-list mailing

[issue7100] test_xmlrpc: global name 'stop_serving' is not defined

2011-01-26 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7100 ___ ___ Python-bugs-list mailing

[issue10993] HTTPSConnection does not close when call close() method

2011-01-24 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10993 ___ ___ Python-bugs-list

[issue10983] Errors in http.client.HTTPConnection class (python3)

2011-01-24 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10983 ___ ___ Python-bugs-list

[issue5885] uuid.uuid1() is too slow

2011-01-24 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5885 ___ ___ Python-bugs-list mailing

[issue10911] cgi: add more tests

2011-01-24 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10911 ___ ___ Python-bugs-list

[issue2193] Cookie Colon Name Bug

2010-10-18 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: My Java may be a bit rusty, but it seems that it would filter out the colon. tspecials contains a colon and thus having a colon in the cookie name would make in invalid. I glanced at the Perl code and couldn't find where it filtered out any

[issue1210680] Split email headers near a space

2010-08-17 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1210680 ___ ___ Python-bugs-list

[issue7275] CoverageResult fails to merge input file with non-empty callers in trace.py (patch)

2010-08-17 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7275 ___ ___ Python-bugs-list mailing

[issue8722] Documentation for __getattr__

2010-08-17 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8722 ___ ___ Python-bugs-list mailing

[issue5843] Possible normalization error in urlparse.urlunparse

2010-08-17 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5843 ___ ___ Python-bugs-list mailing

[issue7159] Urllib2 authentication memory.

2010-08-17 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7159 ___ ___ Python-bugs-list mailing

[issue9417] Declaring a class creates circular references

2010-08-17 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9417 ___ ___ Python-bugs-list mailing

[issue1573931] WSGI, cgi.FieldStorage incompatibility

2010-08-04 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1573931 ___ ___ Python-bugs-list

[issue5587] vars() no longer has a useful __repr__

2010-08-04 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: A possible fix is to add a __repr__ implementation to proxydict. I've attached a patch and also posted it to: http://codereview.appspot.com/1908043. -- keywords: +patch nosy: +dstanek Added file: http://bugs.python.org/file18376/5587

[issue9500] urllib2: Content-Encoding

2010-08-03 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9500 ___ ___ Python-bugs-list mailing

[issue7013] Httplib read routine is not tolerant to not well-formed chunked http responses.

2010-08-03 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7013 ___ ___ Python-bugs-list mailing

[issue5931] Python runtime name hardcoded in wsgiref.simple_server

2010-08-03 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5931 ___ ___ Python-bugs-list mailing

[issue8280] urllib2 passes fragment identifier to server

2010-08-03 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: Added a patch to fix this behavior. -- keywords: +patch nosy: +dstanek Added file: http://bugs.python.org/file18358/fragment.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue8280] urllib2 passes fragment identifier to server

2010-08-03 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: I have also uploaded my patch to http://codereview.appspot.com/1918042 so easier viewing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8280

[issue754016] urlparse goes wrong with IP:port without scheme

2010-08-03 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: I've reworked the patch so that it applied against the py3k branch. It's been attached to this issue and is also available here: http://codereview.appspot.com/1910044. -- nosy: +dstanek Added file: http://bugs.python.org/file18362

[issue6602] BaseHTTPServer log_message should log to sys.stdout

2010-08-03 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: I think this is the right thing to do. To help this along I've included a patch. The codereview is also available: http://codereview.appspot.com/1697062. -- keywords: +patch nosy: +dstanek Added file: http://bugs.python.org/file18365

[issue8757] Race condition when checking for set in set

2010-08-03 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8757 ___ ___ Python-bugs-list mailing

[issue7464] circular reference in HTTPResponse by urllib2

2010-08-03 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: Does this issue still exist? I did a little poking around at could not find the quoted code. -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7464

[issue1673007] urllib2 requests history + HEAD support

2010-08-03 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: I have attached a patch to add support for HEAD, PUT and DELETE methods. The code review is available here: http://codereview.appspot.com/1696061. I have started working on another patch that validates that the method is properly set

[issue8150] urllib needs ability to set METHOD for HTTP requests

2010-08-03 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: In issue #1673007 I submitted a patch that enables the programmer to create a Request instance and specify the method to use. -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http

[issue4493] urllib2 doesn't always supply / where URI path component is empty

2010-08-01 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4493 ___ ___ Python-bugs-list mailing

[issue9141] Allow objects to decide if they can be collected by GC

2010-07-31 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9141 ___ ___ Python-bugs-list mailing

[issue2244] urllib and urllib2 decode userinfo multiple times

2010-07-31 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2244 ___ ___ Python-bugs-list mailing

[issue2304] subprocess under windows fails to quote properly when shell=True

2010-07-31 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2304 ___ ___ Python-bugs-list mailing

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-07-31 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7839 ___ ___ Python-bugs-list mailing

[issue9370] Add reader redirect from test package docs to unittest module

2010-07-31 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9370 ___ ___ Python-bugs-list mailing

[issue6293] Have regrtest.py echo back sys.flags

2010-07-31 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6293 ___ ___ Python-bugs-list mailing

[issue8910] Write a text file explaining why Lib/test/data exists

2010-07-31 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8910 ___ ___ Python-bugs-list mailing

[issue7331] Command line testing consistency between 2.x and 3.x

2010-07-31 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7331 ___ ___ Python-bugs-list mailing

[issue7325] tempfile.mkdtemp() does not return absolute pathname when dir is specified

2010-07-31 Thread David Stanek
Changes by David Stanek dsta...@dstanek.com: -- nosy: +dstanek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7325 ___ ___ Python-bugs-list mailing

[issue8572] httplib getheader() throws error instead of default

2010-07-31 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: I created some tests for the existing behavior and the expected behavior. One of my apps was passing in a tuple and the default. Since this already worked and there are probably others besides me expecting this behavior I changed the patch

[issue8572] httplib getheader() throws error instead of default

2010-07-31 Thread David Stanek
David Stanek dsta...@dstanek.com added the comment: Adding a patch that includes a documentation change. -- Added file: http://bugs.python.org/file18302/8572-with-docs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8572

Re: Function to apply superset of arguments to a function

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 12:45 PM, Andrey Fedorovanfedo...@gmail.com wrote: Hi all, I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting, and calls the function with only those arguments. This is meant to suppress

Re: HTTP POST File without cURL

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 1:57 PM, John D Giottajdgio...@gmail.com wrote: I'm working with an API that allows me to POST a zip file via HTTP and the documentation uses a cURL example. cURL works, but when I try to POST the file via python it fails. I don't want to use cURL (since I'm trying to be

Re: Function to apply superset of arguments to a function

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 5:03 PM, Melmwil...@the-wire.com wrote: David Stanek wrote: On Wed, Sep 9, 2009 at 12:45 PM, Andrey Fedorovanfedo...@gmail.com wrote: I've written a function [1] called apply_some which takes a set of keywords arguments, filters only those a function is expecting

Re: Python server locks up

2009-09-09 Thread David Stanek
On Wed, Sep 9, 2009 at 4:28 PM, Zac Burnszac...@gmail.com wrote: How would you suggest to figure out what is the problem? I don't think you said your OS so I'll assume Linux. Sometimes it is more noise than value, but stracing the process may shed light on what system calls are being made.

Re: hashability

2009-08-12 Thread David Stanek
On Wed, Aug 12, 2009 at 2:18 AM, Asun Friereafri...@yahoo.co.uk wrote: On Aug 12, 3:32 pm, James Stroud nospamjstroudmap...@mbi.ucla.edu wrote: You should be more imaginative. I'm by no means discounting that there might be some actual problem you're trying to solve here, but I honestly

Re: httplib incredibly slow :-(

2009-08-12 Thread David Stanek
On Tue, Aug 11, 2009 at 4:25 PM, Chris Withersch...@simplistix.co.uk wrote: Hi All, I'm using the following script to download a 150Mb file: from base64 import encodestring from httplib import HTTPConnection from datetime import datetime conn = HTTPSConnection('localhost') headers = {}

Re: Is feedparser deprecated?

2009-08-08 Thread David Stanek
On Fri, Aug 7, 2009 at 3:07 PM, John Naglena...@animats.com wrote:  Feedparser requires SGMLlib, which has been removed from Python 3.0. Feedparser hasn't been updated since 2007. Does this mean Feedparser is dead? The release is from 2007, but there are several recent commits.

Re: sqlite3 performance problems only in python

2009-07-23 Thread David Stanek
On Thu, Jul 23, 2009 at 9:02 AM, Stef Mientkistef.mien...@gmail.com wrote: btw, I don't know if it's of any importance, the SQL-statement I perform is select OPNAMEN.*, NAME, NAME_, SCORES.SCORE, PATIENT.*  from OPNAMEN   inner join POID_VLID          on OPNAMEN.POID            =

Re: sqlite3 performance problems only in python

2009-07-23 Thread David Stanek
On Thu, Jul 23, 2009 at 6:29 PM, Stef Mientkistef.mien...@gmail.com wrote: but because the same SQL-statement in Delphi performed well, I thought it was a problem with the Python implementation. Same SQL, but were you also using Sqlite in Delphi? -- David blog: http://www.traceback.org

Re: Changing the private variables content

2009-07-21 Thread David Stanek
On Tue, Jul 21, 2009 at 6:00 PM, Rhodri Jamesrho...@wildebst.demon.co.uk wrote: On Tue, 21 Jul 2009 21:55:18 +0100, Ryniek90 rynie...@gmail.com wrote: Hi. I'm writing some class, and decided to use inside private method and some private variables. While with method i haven't got any problem's

Re: Python import Error

2009-07-18 Thread David Stanek
On Sat, Jul 18, 2009 at 3:14 AM, Kalyan Chakravarthykalyanchakravar...@hyit.com wrote: Hi All,    I am using Python 2.6, MySQL 4.0 , I have successfully Instaled MySQLdb (MySQL-python-1.2.3c1.win32-py2.6) in my system. I tested through command prompt with import MySQLdb , its

Re: Override a method but inherit the docstring

2009-07-17 Thread David Stanek
On Fri, Jul 17, 2009 at 2:58 AM, Peter Otten__pete...@web.de wrote: Ben Finney wrote: Howdy all, The following is a common idiom::     class FooGonk(object):         def frobnicate(self):             Frobnicate this gonk.             basic_implementation(self.wobble)     class

Re: Override a method but inherit the docstring

2009-07-17 Thread David Stanek
On Fri, Jul 17, 2009 at 3:52 AM, Steven D'Apranost...@remove-this-cybersource.com.au wrote: On Fri, 17 Jul 2009 12:58:48 +1000, Ben Finney wrote: Using a decorator in this manner requires repeating the super class name.  Perhaps there is a way to get the bases of BarGonk, but I don't think

Re: How to unbuffer Python's output

2009-07-14 Thread David Stanek
2009/7/14 Lily Gao lily@autodesk.com: Hi, All I am calling a python program in perl and use redirection, Like : `python x.py 1.log 21` Try tihs instead: python x.py 21 1.log -- David blog: http://www.traceback.org twitter: http://twitter.com/dstanek --

Re: Looking for the right library for a simple HTTP client

2009-07-10 Thread David Stanek
On Fri, Jul 10, 2009 at 1:29 AM, scriptlear...@gmail.comscriptlear...@gmail.com wrote: I am trying to implement a simple client that can do the following: 1)to send the following kinds of HTTP requests and validate responses 1.1 GET 1.2 POST with application/x-www-form-urlencoded encoding 1.3

Re: Unexpected behaviour of inner functions/ decorators

2009-06-30 Thread David Stanek
On Tue, Jun 30, 2009 at 1:44 PM, Francesco Bochicchiobieff...@gmail.com wrote: [snip] It looks like the decorator uses an older  instance of 'funct', which does not yet have the attribute dinamically attached to it. This seem to be confirmed by the fact that adding the attribute before

Re: Get name of class without instance

2009-06-24 Thread David Stanek
Try Foo.__name__ if Foo is a class object. On 6/24/09, Bryan bryanv...@gmail.com wrote: Given a class: class Foo(object): pass How can I get the name Foo without having an instance of the class? str(Foo) gives me more than just the name Foo. __main__.Account Foo.__class__.__name__

Re: Guidance on initialization code in a module

2009-06-16 Thread David Stanek
On Tue, Jun 16, 2009 at 4:54 PM, mrstevegrossmrstevegr...@gmail.com wrote: Is there a common way to initialize various stuff in a module? That is, I have some code in my module that I want to run whenever the module is imported. Currently, my module looks like this: === foo.py === def

Re: Odd closure issue for generators

2009-06-08 Thread David Stanek
On Thu, Jun 4, 2009 at 7:42 PM, Scott David Danielsscott.dani...@acm.org wrote: Brian Quinlan wrote: This is from Python built from the py3k branch:   c = (lambda : i for i in range(11, 16))   for q in c: ...     print(q()) ... 11 12 13 14 15   # This is expected   c = (lambda : i

Re: pylint naming conventions?

2009-06-07 Thread David Stanek
On Sun, Jun 7, 2009 at 9:23 AM, Esmailebo...@hotmail.com wrote: Ben Finney wrote: Esmail ebo...@hotmail.com writes: I am confused by pylint's naming conventions, I don't think the are in tune with Python's style recommendations (PEP 8?) Anyone else think this? It's hard to know, without

Re: try except inside exec

2009-05-29 Thread David Stanek
On Fri, May 29, 2009 at 11:55 AM, Michele Petrazzo michele.petra...@remove_me_unipex.it wrote: My goal is to execute a function received from a third-part, so I cannot modify as you made in your first piece of code. I want a clean exception with the real line code/tb so I can show a real

Re: strip char from list of strings

2009-05-19 Thread David Stanek
On Mon, May 18, 2009 at 3:30 PM, Laurent Luce laurentluc...@yahoo.com wrote: I have the following list: [ 'test\n', test2\n', 'test3\n' ] I want to remove the '\n' from each string in place, what is the most efficient way to do that ? What have you tried so far? -- David blog:

Re: Performance java vs. python

2009-05-19 Thread David Stanek
On Tue, May 19, 2009 at 5:43 PM, namekuseijin namekusei...@gmail.com wrote: someone said: If you took a look at Java, you would notice that the core language syntax is much simpler than Python's. thanks for the laughs whoever you are! I'm no Java fan, but I do agree that the core language

Re: Python code-bloat tool-- warning n00b stuff...

2009-05-18 Thread David Stanek
On Mon, May 18, 2009 at 12:45 PM, david wright I would suggest looking into TDD (test driven development). This technique would be a good fit to eliminate you feeling of code bloat, in TDD you only write the necessary amount of code to make your test pass, hence you never write code that is

Re: object query assigned variable name?

2009-05-02 Thread David Stanek
On Fri, May 1, 2009 at 12:48 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 01 May 2009 09:24:10 -0700, warpcat wrote: I'd like it to print, when instanced, something like this: s = Spam() I’m assigned to s! But it seems prohibitively hard (based on my web and

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread David Stanek
On Thu, Apr 23, 2009 at 2:47 AM, Daniel Fetchinson fetchin...@googlemail.com wrote: The OP is just thinking out loud that it would be great if developers could count on some help for testing various platforms and versions. And I agree, it would indeed be great. I think you interpreted the OP

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread David Stanek
On Thu, Apr 23, 2009 at 12:33 AM, David Lyon david.l...@preisshare.net wrote: Hi Steve, Why should the package developer dictacte which python version the package will run on ? Because they're the developer. Who else should decide what Python versions to support? The developer shouldn't be

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread David Stanek
On Thu, Apr 23, 2009 at 1:12 PM, norseman norse...@hughes.net wrote: BB's, User Lists, all repositories can make these required before acceptance. This is open source. I volunteer my time on the projects that I maintain. If you don't like the quality or lack of documentations, tests, etc.

Re: Configuring pylint for local conventions (was: pyflakes, pylint, pychecker - and other tools)

2009-04-23 Thread David Stanek
On Thu, Apr 23, 2009 at 12:00 PM, Aahz a...@pythoncraft.com wrote: In article 874owf4gky.fsf...@benfinney.id.au, Ben Finney  ben+pyt...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: Second, you can configure pylint to respect your personal style How? I haven't seen any decent

Re: Configuring pylint for local conventions

2009-04-23 Thread David Stanek
On Thu, Apr 23, 2009 at 10:21 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Ben Finney ben+pyt...@benfinney.id.au writes: David Stanek dsta...@dstanek.com writes: I believe you just:   pylint --generate-rcfile ~/.pylintrc and then customize that file. This is the part that I'm

Re: execfile (exec?) create non consistent locals() state

2009-04-22 Thread David Stanek
I expected exec to work the same, but apparently I was wrong. Is there is a way to exec a file more correctly? thus avoid the need to resort to awkward solutions such as using the locals() dictionary? I don't know personally. Perhaps a kind soul will chime in. Why not just exec into a

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-22 Thread David Stanek
On Wed, Apr 22, 2009 at 7:06 PM, David Lyon david.l...@preisshare.net wrote: One of the big challenges for Python going forward is providing a testing infrastructure for Python Packages. There are now over 6,000 packages listed on PyPi - and this number can only get bigger. Interesting

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-22 Thread David Stanek
On Wed, Apr 22, 2009 at 10:39 PM, David Lyon david.l...@preisshare.net wrote: Hi David, Yes, I agree... But as an end-application-developer, I would put it to you that it is a lot of effort for developers to humanly contact the package developers every time we end-developers find a bug.

Re: Passing all extra commandline arguments to python program, Optparse raises exception

2009-04-19 Thread David Stanek
On Thu, Apr 16, 2009 at 10:05 AM, sapsi saptarshi.g...@gmail.com wrote: Hello, Im using optparse and python 2.6 to parse some options, my commandline looks like prog [options] start|stop extra-args-i-will-pas-on The options are --b --c --d The extra options are varied are are passed onto

Re: Imports in python are static, any solution?

2009-04-13 Thread David Stanek
On Mon, Apr 13, 2009 at 11:59 AM, Ravi ra.ravi@gmail.com wrote: foo.py :    i = 10   def fi():      global i      i = 99 bar.py :    import foo    from foo import i    print i, foo.i    foo.fi()    print i, foo.i This is problematic. Well I want i to change with foo.fi() .

Re: Spring-like IoC in python?

2009-04-05 Thread David Stanek
On Sun, Apr 5, 2009 at 5:51 AM, Giovanni Giorgi j...@objectsroot.com wrote: Hi all, I have just read the Thread Thoughts on language-level configuration support? started by jfager. I have worked in the past days with Java Spring. I found very valuable the ideas behind Inversion of Control

Re: Spring-like IoC in python?

2009-04-05 Thread David Stanek
On Sun, Apr 5, 2009 at 9:24 AM, andrew cooke and...@acooke.org wrote: David Stanek wrote: [...] The documentation is a little lacking, but that will be changing in the next few days. Examples of using snake-guice with CherryPy, Django and TurboGears are just a few days off as well. The API

Re: Thoughts on language-level configuration support?

2009-03-31 Thread David Stanek
On Mon, Mar 30, 2009 at 9:40 AM, jfager jfa...@gmail.com wrote: I've written a short post on including support for configuration down at the language level, including a small preliminary half-functional example of what this might look like in Python, available at http://jasonfager.com/?p=440.

Re: Thoughts on language-level configuration support?

2009-03-31 Thread David Stanek
On Tue, Mar 31, 2009 at 3:19 AM, jfager jfa...@gmail.com wrote: Simply having a configuration file - okay.  What format?  What if the end user wants to keep their configuration info in LDAP?  Did the library I'm including make the same decisions, or do I have to do some contortions to adapt?  

Re: Thoughts on language-level configuration support?

2009-03-31 Thread David Stanek
On Tue, Mar 31, 2009 at 10:01 AM, jfager jfa...@gmail.com wrote: On Mar 31, 6:02 am, David Stanek dsta...@dstanek.com wrote: On Tue, Mar 31, 2009 at 3:19 AM, jfager jfa...@gmail.com wrote: Simply having a configuration file - okay.  What format?  What if the end user wants to keep

Re: Thoughts on language-level configuration support?

2009-03-31 Thread David Stanek
On Tue, Mar 31, 2009 at 9:42 PM, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message 36148830-22c0-4f19-ab23- d04d8755a...@s28g2000vbp.googlegroups.com, jfager wrote: I've written a short post on including support for configuration down at the language level ... If

Re: __init__ vs. __del__

2009-03-22 Thread David Stanek
2009/3/21 Randy Turner rtms...@yahoo.com: There are a number of use-cases for object cleanup that are not covered by a generic garbage collector... For instance, if an object is caching data that needs to be flushed to some persistent resource, then the GC has no idea about this. It seems

Re: Style question - defining immutable class data members

2009-03-14 Thread David Stanek
On Sat, Mar 14, 2009 at 12:32 PM, Maxim Khitrov mkhit...@gmail.com wrote: Very simple question on the preferred coding style. I frequently write classes that have some data members initialized to immutable values. For example: class Test(object):    def __init__(self):        

Re: Why is lambda allowed as a key in a dict?

2009-03-09 Thread David Stanek
On Mon, Mar 9, 2009 at 11:07 PM, Daniel Fetchinson fetchin...@googlemail.com wrote: Python 2.5.1 (r251:54863, Oct 30 2007, 13:45:26) [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2 Type help, copyright, credits or license for more information. x = { } x[lambda arg: arg] = 5 x[lambda arg:

Re: PyPI editing

2009-03-05 Thread David Stanek
On Thu, Mar 5, 2009 at 3:32 AM, andrew cooke and...@acooke.org wrote: Apparently not (this will probably change, but see http://pypi.python.org/pypi/LEPL/2.0.1 which is currently displaying restructured text literally) Did you put the ReST in the description or the long_description? Take a

Re: SVN/CVS and Branching

2009-02-19 Thread David Stanek
On Thu, Feb 19, 2009 at 7:10 AM, Jeff Dyke jeff.d...@gmail.com wrote: Fair enough. Say my project is called foo, and it has many submodules. So there are imports that may look like `import foo.bar` or `from foo.bar import baz`, if i change the top level directory, it is no longer foo and

Re: Code coverage to Python code

2009-01-04 Thread David Stanek
On Sun, Jan 4, 2009 at 9:26 PM, Roy Smith r...@panix.com wrote: In article mailman.6574.1231108877.3487.python-l...@python.org, Robert Kern robert.k...@gmail.com wrote: Hussein B wrote: Hey, What is the best code coverage tool available for Python? I like Titus Brown's figleaf.

  1   2   >