Re: IDE recommendation please

2005-10-23 Thread Brendan
As mentioned, there isn't a whole lot. I've beta tested Komodo, and it looks promising. SPE might start working now that stani has a mac. For now I use TextWrangler - a free text editor with good python support. http://www.barebones.com/products/textwrangler/index.shtml For interactive python,

Newbie Alert: Help me store constants pythonically

2005-11-06 Thread Brendan
structure since I don't have the experience to decide the merits of each in advance. I get way too frustrated about these things :) Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Alert: Help me store constants pythonically

2005-11-06 Thread Brendan
Thanks for the vote FB. The reason I'm using that method for assigning instance attributes is that the argument list for __init__ is LOOONG. (There are many constants, I only gave two for the examples). I wanted to avoid typing them out twice. -- http://mail.python.org/mailman/listinfo/python-l

Re: ? MDI depreciated

2005-11-06 Thread Brendan
This is probably a question better suited for a wxPython or MSDN newsgroup. What OS are you referring to? What GUI toolkit are you using? Microsoft's office on Windows has moved to a model where every document has its own toolbar, menubar, and taskbar entry. Windows developers tend to mimic MS

Re: Newbie Alert: Help me store constants pythonically

2005-11-07 Thread Brendan
type=3, z=8) ] ) which I'm not sure the .ini format can easily support. I could use (key buzzword voice) XML, but I fear that might send me down the 'overcomplicating things' path. Your suggestion has given me some new places to search Google (configparser, python config files), so I'll look around for better ideas. Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: XML GUI

2005-11-08 Thread Brendan
zone/element-index.htm) Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Alert: Help me store constants pythonically

2005-11-08 Thread Brendan
ted. Otherwise, this might be a reasonable avenue for standardizing Python. (I hope that doesn't draw to many flames :) Brendan. -- http://mail.python.org/mailman/listinfo/python-list

Re: SPE IDE for Python

2005-11-08 Thread Brendan
SPE doesn't yet integrate with CVS, but it's in active development. CVS support may come sooner than later. I have been demoing Komodo which integrates with CVS, SVN and perforce. I've been very impressed. http://aspn.activestate.com/ASPN/docs/Komodo/3.1/komodo-doc-scc.html On my pc I just use t

Checking length of each argument - seems like I'm fighting Python

2005-12-03 Thread Brendan
way to check that either all arguments are scalars, or all are lists of the same length? Is this a poor way to structure things? Your advice is appreciated Brendan -- Brendan Simons -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking length of each argument - seems like I'm fighting Python

2005-12-04 Thread Brendan
I am coming at this with a "C++ mindset) but at least I have tools to do it efficiently :) Brendan -- http://mail.python.org/mailman/listinfo/python-list

Help me dig my way out of nested scoping

2005-04-03 Thread Brendan
#finally, call the third party function and return its result return F(AW, BW) # end code - OK, here's my problem: How do I best store and change lastX, A(lastX) and B(lastX) in FW's scope? This seems like it should be easy, but I'm stuck. Any help would

Re: Help me dig my way out of nested scoping

2005-04-03 Thread Brendan
Thanks for the tips. Making FW a callable class (choice 5) seems to be a good (if verbose) solution. I might just wrap my temporary values in a list [lastX, lastA, lastB] and mutate them as Michael suggests. Thanks to Michael especially for the explanation of the name-binding process that's at th

Re: Help me dig my way out of nested scoping

2005-04-03 Thread Brendan
F -is- in fact an iterative optimizer that minimizes A on x (B is the derivative of A). So yes, F will call A and B on mulitple 'x's. In that case, it seems the mutable object trick is the way to go. Thanks. I didn't follow your last sentence. What about the Python Cookbook? -- http://mail.

Re: Help me dig my way out of nested scoping

2005-04-03 Thread Brendan
>James Stroud Apr 3, 3:18 pm: >I think you might want to look at "python generators". I've seen discussion of generators before, but haven't invested the time to understand them yet. This might be a good excuse. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDE (was: PythonWin troubleshooting)

2005-12-16 Thread Brendan
I use Komodo now, and love it. It has all the features you'd expect: code completion, object browsing, folding, docstring previews etc. Of course it's the only full-featured, native and stable Python IDE currently available for the mac (SPE is close), so my choice is limited. Brenda

Re: New Python.org website ?

2006-01-13 Thread Brendan
ac.org/packages/ Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: Serializing / Unserializing datetime

2006-05-28 Thread Brendan
Thanks John. I've discovered that datetime.strptime will be available in 2.5, (http://docs.python.org/dev/whatsnew/modules.html) but your example will work in the meantime. BJ -- http://mail.python.org/mailman/listinfo/python-list

Python 2.5 WinXP AMD64

2006-09-21 Thread Brendan
Hello, I just tried to use the Windows XP installer for Python 2.5 AMD64 but I get the error message: "Installation package not supported by processor type" I am running Windows XP Pro on an AMD Athon 64 Processor. Do I need to have a 64-bit OS to use this version? -- http://mail.python.org/mai

Re: Python 2.5 WinXP AMD64

2006-09-21 Thread Brendan
Thanks. Christophe wrote: > Brendan a écrit : > > Hello, > > I just tried to use the Windows XP installer for Python 2.5 AMD64 but I > > get the error message: "Installation package not supported by processor > > type" > > > > I am running Windows

Why are the topic and keyword documentation not includded in the chm?

2006-09-22 Thread Brendan
1)Why are the topic and keyword documentation not included in the Windows installation chm? I have to have both the html(with the env var PYTHONDOCS set) and the chm installed? What is the point of that? 2)Is there no simple way to open the chm docs in a browser from within python? 3)How do I op

Re: Scientific Computing with NumPy

2006-02-06 Thread Brendan
As of version 0.4.x, Scipy exclusively uses the newer NumPy module instead of the older Numeric module. The confusion is inevitable in this time of transition, but their intent is to standardize on one array package. Brendan -- Brendan Simons mclaugb wrote: > This page documents

Re: Using python for a CAD program

2006-05-17 Thread Brendan
ine how useful this is. Now that I've switched to Solidworks, my drafting speed has doubled. I haven't seen anyone make a 2D cad package with this behaviour. I'm sure there's a market for one if you go that route. -Brendan -- http://mail.python.org/mailman/listinfo/python-list

Serializing / Unserializing datetime

2006-05-27 Thread Brendan
y there don't seem to be "fromstring" equivalents for datetime.ctime or datetime.isoformat. Ideally the serialized datetime should be human readable, and potentially parseable from other languages. Any suggestions? Brendan -- Brendan Simons -- http://mail.python.org/mailman/listinfo/python-list

Reading online zip files - zipfile and zlib, wbits

2008-12-12 Thread Brendan
I am fooling around with accessing contents of zip files online. I download the tail end of the zip and use zipfile to get the zip central directory structure. I download the section of the zip file I need, directly read the zip file headers and use that information with zlib to uncompress the data

Re: Reading online zip files - zipfile and zlib, wbits

2008-12-12 Thread Brendan
On Dec 12, 10:25 am, Brendan wrote: > I am fooling around with accessing contents of zip files online. I > download the tail end of the zip and use zipfile to get the zip > central directory structure. I download the section of the zip file I > need, directly read the zip file hea

Re: Reading online zip files - zipfile and zlib, wbits

2008-12-12 Thread Brendan
On Dec 12, 10:46 am, Brendan wrote: > On Dec 12, 10:25 am, Brendan wrote: > > > I am fooling around with accessing contents of zip files online. I > > download the tail end of the zip and use zipfile to get the zip > > central directory structure. I download the s

Re: Reading online zip files - zipfile and zlib, wbits

2008-12-12 Thread Brendan
On Dec 12, 11:36 am, Brendan wrote: > On Dec 12, 10:46 am, Brendan wrote: > > > > > > > On Dec 12, 10:25 am, Brendan wrote: > > > > I am fooling around with accessing contents of zip files online. I > > > download the tail end of the zip and use z

zipfile.is_zipfile() and string buffers

2008-12-16 Thread Brendan
I would like zipfile.is_zipfile(), to operate on a cStringIO.StringIO string buffer, but is seems only to accept file names as arguments. Should it not be able to handle string buffers too? -- http://mail.python.org/mailman/listinfo/python-list

ftplib - 226 message not received

2009-01-08 Thread Brendan
I am trying to download a file within a very large zipfile. I need two partial downloads of the zipfile. The first to get the file byte offset, the second to get the file itself which I then inflate. I am implementing the partial downloads as follows: con = ftp.transfercmd('RETR ' + filename, res

Re: ftplib - 226 message not received

2009-01-08 Thread Brendan
Okay, found it on my own. ftp.voidresp() is what is needed, and it does _not_ seem to be in the Python documentation for ftplib. On Jan 8, 1:58 pm, Brendan wrote: > I am trying to download a file within a very large zipfile. I need two > partial downloads of the zipfile. The first to g

Installing multiple python versions - CentOs Linux

2008-10-17 Thread Brendan
The current CentOs Linux distro includes python 2.4.3. I need to install a more recent version but I am worried about breaking CentOs python dependencies. Is it safe to install python 2.6 using pup? -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing multiple python versions - CentOs Linux

2008-10-17 Thread Brendan
> If you install from sources, the safest path is to run > > $ sudo make altinstall (will add the version number to the executable) > > and NOT > > $ sudo make install Ah, that is perfect. Thank-you! -- http://mail.python.org/mailman/listinfo/python-list

B-Soup: broken iterator, tag a keyword?

2008-07-10 Thread Brendan
Hi there, I have the following using Beautiful Soup: soup = BeautifulSoup(data) tags = soup.findAll(href=re.compile("/MER_FRS_L2_Canada/MER_FRS_\S +gz")) for tag in tags: print tag['href'] print tag.parent.nextSibling.string print tag.parent.nextSibling.nextSibling.string print tag

urllib2 HTTPBasicAuthHandler and resumingbroken downloads

2008-08-21 Thread Brendan
Is there any way to resume an https file download using urllib2 and an HTTPBasicAuthHandler? -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 HTTPBasicAuthHandler and resumingbroken downloads

2008-08-22 Thread Brendan
On Aug 21, 3:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 21 Aug 2008 15:37:41 -0300, Brendan <[EMAIL PROTECTED]>   > escribi : > > > Is there any way to resume an https file download using urllib2 and an > > HTTPBasicAuthHandler? &

Re: urllib2 HTTPBasicAuthHandler and resumingbroken downloads

2008-08-25 Thread Brendan
On Aug 22, 1:59 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 22 Aug 2008 08:55:57 -0300, Brendan <[EMAIL PROTECTED]>   > escribi : > > > > > > > On Aug 21, 3:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wr

Python 2.6 ftplib has timeout parameter, but how to detect a timeout

2009-12-14 Thread Brendan
I was quite happy to see that ftplib in Python 2.6 now has a timeout parameter. With large file downloads my script would often hang, presumably from timing out. Now that there is a timeout parameter, how would I detect when a timeout occurs? -- http://mail.python.org/mailman/listinfo/python-list

Re: ftplib retrlines timeout

2009-12-16 Thread Brendan
On Dec 15, 6:17 pm, Jennifer wrote: > I am writing a program that has a requirement for  a timeout of > retrlines after the connection established. I just wonder if timeout > of ftplib.FTP('.xxx.com',username,password,timeout) will work for > retrlines method after the connection established.

KirbyBase : replacing string exceptions

2009-11-23 Thread Brendan
In KirbyBase there is a method that uses string exceptions for control, even though it has a defined exception. Is there any reason the string exceptions below could not be replaced? i.e. in code below replace: raise "No Match" with: raise KBError() and except 'No Match': with: except KBError: I h

Re: KirbyBase : replacing string exceptions

2009-11-23 Thread Brendan
On Nov 23, 12:21 pm, Steve Howell wrote: > On Nov 23, 7:22 am, Brendan wrote: > > > In KirbyBase there is a method that uses string exceptions for > > control, even though it has a defined exception. Is there any reason > > the string exceptions below could not be re

pywin32 - word object reference module - automating form filling

2009-06-09 Thread Brendan
I was hoping to use pywin32 to automate some rather tedious filling in of Word forms. I thought -- http://mail.python.org/mailman/listinfo/python-list

pywin32 - word object reference module - automating form filling

2009-06-09 Thread Brendan
I was hoping to use pywin32 to automate some rather tedious filling in of Word forms. I thought -- http://mail.python.org/mailman/listinfo/python-list

pywin32 - word object reference module - automating form filling

2009-06-09 Thread Brendan
I was hoping to use pywin32 to automate some rather tedious filling in of Word forms. I thought the process would be analogous to dealing with xml documents or DOM but find myself somewhat lost in the word object reference manual (http://msdn.microsoft.com/en-us/library/ bb244515.aspx) . I was hop

Re: pywin32 - word object reference module - automating form filling

2009-06-09 Thread Brendan
On Jun 9, 9:54 am, Brendan wrote: > I was hoping to use pywin32 to automate some rather tedious filling in > of Word forms. I thought the process would be analogous to dealing > with xml documents or DOM but find myself somewhat lost in the word > object reference

Alter list items within loop

2009-06-11 Thread Brendan
Can someone please explain what is happening in the output below? The number 3 never gets printed. Does Python make a copy of a list before it iterates through it?: >>> e = range(1,5) >>> for i in e: print i if i == 2 : e.remove(i) 1 2 4 >>> e [1, 3, 4] -- http://

exit() or sys.exit()

2009-06-17 Thread Brendan
What is the difference on exit() and sys.exit() when called in the main body of a script? From the command line they seem to have the same effect. Aside: Just used a python dictionary in which the keys were compiled regular expressions. Provided a very elegant solution. Have to love it. -- http:/

Re: exit() or sys.exit()

2009-06-17 Thread Brendan
On Jun 17, 1:33 pm, Tim Chase wrote: > Brendan wrote: > > What is the difference on exit() and sys.exit() when called in the > > main body of a script? From the command line they seem to have the > > same effect. > > In Python <=2.4 you had to use sys.exit() becaus

embarrassing class question

2010-10-21 Thread Brendan
Two modules: x.py: class x(object): pass y.py: from x import x class y(x): pass Now from the python command line: >>> import y >>> dir(y) ['__builtins__', '__doc__', '__file__', '__name__', '__package__', 'x', 'y'] I do not understand why class 'x' shows up here. -- http://mail.python.o

Re: embarrassing class question

2010-10-21 Thread Brendan
On Oct 21, 3:47 pm, Carl Banks wrote: > On Oct 21, 11:09 am, Brendan wrote: > > > > > > > Two modules: > > x.py: > > class x(object): > >     pass > > > y.py: > > from x import x > > class y(x): > >     pass > > > Now

Re: embarrassing class question

2010-10-21 Thread Brendan
On Oct 21, 3:56 pm, Ethan Furman wrote: > Jonas H. wrote: > > On 10/21/2010 08:09 PM, Brendan wrote: > >> Two modules: > >> x.py: > >> class x(object): > >>      pass > > >> y.py: > >> from x import x > >> class y(x

Re: embarrassing class question

2010-10-22 Thread Brendan
On Oct 22, 5:02 am, Steven D'Aprano wrote: > On Thu, 21 Oct 2010 12:12:34 -0700, Brendan wrote: > >> Because y.py has "from x import x" the x class from x.py is added to > >> the y.py namespace. > > >> ~Ethan~- Hide quoted text - > > &g

Re: embarrassing class question

2010-10-22 Thread Brendan
On Oct 22, 9:16 am, Dave Angel wrote: > On 2:59 PM, Brendan wrote:> On Oct 21, 3:56 pm, Ethan > Furman  wrote: > >> > >> Because y.py has "from x import x" the x class from x.py is added to the > >> y.py namespace. > > >> ~Ethan~- Hid

Re: ftplib - Did the whole file get sent?

2010-10-25 Thread Brendan
On Oct 23, 1:03 pm, Sean DiZazzo wrote: > On Oct 22, 10:48 pm, Steven D'Aprano > cybersource.com.au> wrote: > > On Fri, 22 Oct 2010 22:03:38 -0700, Sean DiZazzo wrote: > > > How can I assure him (and the client) that the transfer completed > > > successfully like my log shows? > > > "It has worke

Re: embarrassing class question

2010-10-25 Thread Brendan
On Oct 22, 2:21 pm, Peter Pearson wrote: > On Fri, 22 Oct 2010 07:49:39 -0700 (PDT), Brendan wrote: > > [snip] > > > > > > > x.py > > class X(object): > >     pass > > > y.py > > import x > > class Y(x.X): > >     pass > >

j2py - overloading __init__

2010-10-25 Thread Brendan
I am posting here in the hopes the author of java2python will see it. Does j2py handle overloading of the __init__ constructor? For me it is calling __init__ and not calling the decorator overloaded __init__0. -- http://mail.python.org/mailman/listinfo/python-list

Re: j2py - overloading __init__

2010-10-25 Thread Brendan
On Oct 25, 12:57 pm, Brendan wrote: > I am posting here in the hopes the author of java2python will see it. > Does j2py handle overloading of the __init__ constructor?  For me it > is calling __init__ and not calling the decorator overloaded __init__0. Never mind. Moronic type mistake.

Re: Python benefits over Cobra

2011-04-05 Thread Brendan Simon
> On 05-Apr-11 06:22 AM, Brendan Simon (eTRIX) wrote: >> >> Any other arguments where Python has benefits over Cobra ?? >> >> Cheers, Brendan. >> > Two questions: > 1. Is Cobra Open Source? > 2. The blog ended on October, did he run out o

Re: Python inner function parameter shadowed

2016-09-13 Thread Brendan Abel
This looks like a decorator function that optionally accepts arguments to change the behavior. You can safely ignore the warning form PyCharm. the variable won't be shadowed it's included in the function signature of the inner function. A lot of times, the outside decorator will just use the *ar

Re: Python inner function parameter shadowed

2016-09-13 Thread Brendan Abel
unction is concerned.) On Tue, Sep 13, 2016 at 11:31 AM, Chris Angelico wrote: > On Wed, Sep 14, 2016 at 4:28 AM, Brendan Abel <007bren...@gmail.com> > wrote: > > This looks like a decorator function that optionally accepts arguments to > > change the behavior. > &g

Re: What is the correct form for saying "licensed under the same terms as Python itself"?

2016-09-14 Thread Brendan Abel
Unless you're actually distributing python (as in, the interpreter or it's source code), you don't need to include the python license or the copyright notice. You also don't need a Contributor agreement just to distribute a python library. That is more for people who are contributing to core Pyth

Re: How to import all things defined the files in a module directory in __init__.py?

2016-09-24 Thread Brendan Abel
> Splitting it up would make it slower to load. It's usually the opposite. When packages are split up, you only have to load the specific portions you need. Putting it all in a single module forces you to always load everything. On Fri, Sep 23, 2016 at 11:59 PM, Lawrence D’Oliveiro < lawrenced.

Re: unintuitive for-loop behavior

2016-09-29 Thread Brendan Abel
Yes, loops don't have their own scope. Indeed, very few flow elements in python -- if, with, try/except -- create a new scope. In that sense, it's fairly consistent, but can be unexpected for people that have used languages with many nested scopes. The lambda behavior is a common gotcha - there

Re: unintuitive for-loop behavior

2016-09-30 Thread Brendan Abel
> a = 1 if condition: print(a) # UnboundLocalError: local 'a' referenced before assignment a += 1 For-loops are no different. Making them their own namespace is a very strange thing to do, it would mean you couldn't re-bind a value inside a for-loop: count = 0 for x in sequence: cou

Re: Passing Variable to Function

2016-10-05 Thread Brendan Abel
Define your colors as actual number variables instead of a string color = (255,0,0) color2 = (0,0,255) Then use argument expansion to pass them in as separate arguments to the function colorFunction(*color) Brendan On Wed, Oct 5, 2016 at 12:17 PM, John McKenzie wrote: > > Hell

Re: User Interface Suggestions? (newbie)

2016-10-05 Thread Brendan Abel
You should look into using PyQt or PySide. They are python bindings for the very popular Qt GUI framework. On Wed, Oct 5, 2016 at 2:33 PM, Beverly Howard wrote: > >> if it is a pi controlling the system I would tend towards controlling it > from a web page via the network. to keep it updating

Are imports supposed to be like this?

2016-05-09 Thread Brendan Abel
t least the "from x.y.z import a" forms of imports, yet they don't work the same as "import x.y.z.a". //Brendan -- https://mail.python.org/mailman/listinfo/python-list

Re: Were is a great place to Share your finished projects?

2016-07-14 Thread Brendan Abel
A lot of these arguments and points have already been made and hashed out on the python-dev list. There's a very good article that one of the python core developers wrote about the decision to move to github http://www.snarky.ca/the-history-behind-the-decision-to-move-python-to-github Basically,

Re: reversed(enumerate(x))

2016-07-20 Thread Brendan Abel
You could create your own generator that wraps enumerate def reverse_enumerate(iterable): for i, val in enumerate(reversed(iterable)): yield len(iterable) - 1 - i, val for i, val in reverse_enumerate(x): ... On Wed, Jul 20, 2016 at 10:42 AM, Ian Kelly wrote: > I had occasion to

Re: Unittest

2016-07-25 Thread Brendan Abel
Generally, all your unittests will be inside a "tests" directory that lives outside your package directory. That directory will be excluded when you build or install your project using your setup.py script. Take a look at some popular 3rd party python packages to see how they structure their proj

Re: Jargons of Info Tech industry

2005-10-13 Thread Brendan Guild
Roedy Green wrote in news:[EMAIL PROTECTED]: > On Tue, 11 Oct 2005 11:45:03 -0400, Mike Meyer <[EMAIL PROTECTED]> wrote > or quoted : > >>Jeff Poskanzer, now *he* has a spam problem. He gets a few million >>spams a day: http://www.acme.com/mail_filtering/ >. > > It is a bit like termites. If we

Re: Jargons of Info Tech industry

2005-10-13 Thread Brendan Guild
Gordon Burditt wrote in news:[EMAIL PROTECTED]: > Does the language allow Javascript to open a new window? Does the > language allow Javascript to trigger a function when a window is > closed? I believe the answer to both questions is YES. Then it > is possible to have a page that pops up two

Re: FTP Windows AS/400

2005-09-13 Thread Brendan Bispham
Hi Tim, On Tuesday 13 September 2005 17:31, Tim G. wrote: > I cannot get the script to switch from native to IFS. Yes you can... > Traceback (most recent call last): > File "C:\Python24\Tools\scripts\ftp400.py", line 9, in ? > ftp.cwd(path) It's the cwd which is having a problem > here

Re: standard IDE in python 3000 (or beyond)? *semi-newbie*

2004-12-30 Thread Brendan Kohler
"mike kreiner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Are there any plans for developing a standard IDE for python that's > included with the python installation? I found information about other > IDE's elsewhere online, but couldn't even find any mention of this > possibilit

Imports and cyclical dependencies

2013-11-13 Thread Brendan Abel
I have a relatively large python package that has several cyclical dependencies. The cyclical dependencies typically aren't a problem so long as I'm just importing modules, and not named attributes (ie. function, class, globals), which may not be defined at a given point in the import routine

what's wrong here? (search script)

2006-07-06 Thread Brendan Fay
[counter + 1:] + searchhelper(initwords, 11 + counter, 1) # (I'm searchhelper2(initwords, urllist, counter + 1)# assuming this is where I have # erred; however, I'm not sure) def search(initwords): urllist = searchhelper(initwords) search

Re: what's wrong here? (search script)

2006-07-06 Thread Brendan Fay
I figured it out. Is there any way to delete your own posts? Brendan Fay wrote: > Dear Someone: > > I have written a script that accesses the googleAPI through > pygoogle and saves each of the ten documents as a .txt file by using a > specific function for each respective

pep 8 constants

2009-01-13 Thread Brendan Miller
ythonic code... so I thought I'd see what the consensus is. Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: pep 8 constants

2009-01-13 Thread Brendan Miller
> FOO = 1 > > def f(x=FOO): > ... > > > Use this instead: > > def f(x=1): > ... I tend to use constants as a means of avoiding the proliferation of magic literals for maintenance reasons... Like say if your example of FOO would have been used in 10 places. Maybe it is more pythonic to simply

what's the point of rpython?

2009-01-16 Thread Brendan Miller
xplained *why* they are doing the things they are doing. Anyway, I can tell this is the sort of question that some people will interpret as rude. Asking hard questions is never polite, but it is always necessary :) Thanks, Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: what's the point of rpython?

2009-01-17 Thread Brendan Miller
>> The goals of the pypy project seems to be to create a fast python >> implementation. I may be wrong about this, as the goals seem a little >> amorphous if you look at their home page. > > The home page itself is ambiguous, and does oversell the performance > aspect. The *actual* goal as outlined

Re: what's the point of rpython?

2009-01-18 Thread Brendan Miller
On Sat, Jan 17, 2009 at 7:57 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > alex23 writes: >> Here's an article by Guido talking about the last attempt to remove >> the GIL and the performance issues that arose: >> >> "I'd welcome a set of patches into Py3k *only if* the performance for

Re: braces fixed '#{' and '#}'

2009-01-18 Thread Brendan Miller
Yes, I also recently noticed the bug in python's parser that doesn't let it handle squigly braces and the bug in the lexer that makes white space significant. I'm surprised the dev's haven't noticed this yet. On Sat, Jan 17, 2009 at 2:09 AM, v4vijayakumar wrote: > I saw some code where someone is

Re: pep 8 constants

2009-01-19 Thread Brendan Miller
> Constants would be a nice addition in python, sure enough. My original question was about PEP-8 and whether it is pythonic to use all caps to denote a variable that shouldn't be changed. More of a style question than a language question. I actually think *enforcing* constantness seems to go aga

Re: what's the point of rpython?

2009-01-19 Thread Brendan Miller
Maybe I'm missing something here but a lock free algorithm for reference counting seems pretty trivial. As long as you can atomically increment and decrement an integer without locking you are pretty much done. For a reference implementation of lock free reference counting on all common platforms

Re: what's the point of rpython?

2009-01-20 Thread Brendan Miller
On Tue, Jan 20, 2009 at 3:46 AM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > s...@pobox.com writes: >> Carl, I'm quite unfamiliar with Boost and am not a C++ person, so may have >> read what you saw but not recognized it in the C++ punctuation soup. I >> couldn't find what you referred to

Re: what's the point of rpython?

2009-01-20 Thread Brendan Miller
On Tue, Jan 20, 2009 at 6:29 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Rhodri James" writes: >> > What cpu's do you know of that can atomically increment and decrement >> > integers without locking? >> >> x86 (and pretty much any 8080 derivative, come to think of it). > > It would

Re: what's the point of rpython?

2009-01-20 Thread Brendan Miller
On Tue, Jan 20, 2009 at 10:03 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Rhodri James" writes: >> You asked a question about CPUs with atomic update, strongly implying >> there were none. All I did was supply a counter-example, > > Well, more specifically, atomic update without loc

Re: what's the point of rpython?

2009-01-21 Thread Brendan Miller
On Wed, Jan 21, 2009 at 8:19 AM, Scott David Daniels wrote: > Brendan Miller wrote: >> >> On Tue, Jan 20, 2009 at 10:03 PM, Paul Rubin >> <"http://phr.cx"@nospam.invalid> wrote: >>> >>> Of course I'm aware of the LOCK prefix but

import reassignment different at module and function scope

2009-01-30 Thread Brendan Miller
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 If I: import sys sys = sys.version This executes find but: import sys def f(): sys = sys.version This gives an error indicating that the sys on the right hand side of = is undefined. What gives? -BEGIN PGP SIGNATURE- Version: GnuPG v1

install modules for specific python version

2009-01-31 Thread Brendan Miller
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have several version of python running side by side on my ubuntu install (2.5,2.6,3.0). I'm installing a module with a setup.py script, in this case logilab-common, so that I can get pylint going. However, I need to install into python 2.6, but by d

documentation link for python 3.0.1 on python.org is broken

2009-02-15 Thread Brendan Miller
Like the title says. -- http://mail.python.org/mailman/listinfo/python-list

PyYaml in standard library?

2009-02-18 Thread Brendan Miller
I'm just curious whether PyYaml is likely to end up in the standard library at some point? -- http://mail.python.org/mailman/listinfo/python-list

Re: PyYaml in standard library?

2009-02-18 Thread Brendan Miller
On Wed, Feb 18, 2009 at 1:34 AM, Chris Rebert wrote: > On Wed, Feb 18, 2009 at 1:11 AM, Brendan Miller wrote: >> I'm just curious whether PyYaml is likely to end up in the standard >> library at some point? > > I don't personally have a direct answer to your quest

hiding modules in __init__.py

2008-10-18 Thread Brendan Miller
nts to see? Or is the best practice just to name the module you don't want clients to use _utility_module and have it private by convention? Thanks, Brendan -- http://mail.python.org/mailman/listinfo/python-list

best python unit testing framwork

2008-11-11 Thread Brendan Miller
or at least how they stack up to each other? Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: best python unit testing framwork

2008-11-14 Thread Brendan Miller
On Thu, Nov 13, 2008 at 3:54 AM, James Harris <[EMAIL PROTECTED]> wrote: > On 11 Nov, 22:59, Brendan Miller <[EMAIL PROTECTED]> wrote: >> What would heavy python unit testers say is the best framework? >> >> I've seen a few mentions that maybe the built in

py2exe linux equivalent

2009-03-20 Thread Brendan Miller
esults and hand them off in a convenient way. Thanks, Brendan -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe linux equivalent

2009-03-20 Thread Brendan Miller
> platform. AFAICT there are RHEL4 rpms for these, and RHEL4 already comes > with its own version of Python so it seems you are attempting to make > things much more difficult than need be. There are no rpm's in our repository for the third party modules I need... If it was that easy I wouldn't be

Re: py2exe linux equivalent

2009-03-20 Thread Brendan Miller
So it sounds like the options are PyInstaller, cx_freeze, and bbfreeze. Has anyone used any of these, and knows which one works best on linux? -- http://mail.python.org/mailman/listinfo/python-list

PyHeapTypeObject

2009-04-11 Thread Brendan Miller
What's the point of PyHeapTypeObject in Include/object.h? Why does the layout of object types need to be different on the heap vs statically allocated? Thanks, Brendan -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >