[issue14995] PyLong_FromString documentation should state that the string must be null-terminated

2012-06-03 Thread Ryan Kelly
New submission from Ryan Kelly r...@rfk.id.au: PyLong_FromString will raise a ValueError if the given string doesn't contain a null byte after the digits. For example, this will result in a ValueError char *pend; PyLong_FromString(1234 extra, pend, 10) While this will successfully read

Re: cause __init__ to return a different class?

2011-09-14 Thread Ryan Kelly
this hides the intention of the code and would require additional documentation or comments: obj = MyBaseClass() # note: actually returns a subclass! Just a thought :-) Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au

[issue11682] PEP 380 reference implementation for 3.3

2011-08-22 Thread Ryan Kelly
Changes by Ryan Kelly r...@rfk.id.au: -- nosy: +rfk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11682 ___ ___ Python-bugs-list mailing list

[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-08-22 Thread Ryan Kelly
Changes by Ryan Kelly r...@rfk.id.au: -- nosy: +rfk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11816 ___ ___ Python-bugs-list mailing list

PyCon Australia 2011: Registration Closing Soon!

2011-08-11 Thread Ryan Kelly
/ Internet: GitHub http://github.com/ Thanks also to Linux Australia, who provide the overarching legal and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed

PyCon Australia 2011: Registration Closing Soon!

2011-08-10 Thread Ryan Kelly
/ Internet: GitHub http://github.com/ Thanks also to Linux Australia, who provide the overarching legal and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed

Re: import hooks (PEP 302) broken in Python =2.5?

2011-08-07 Thread Ryan Kelly
the stdlib module, not import hooks the general concept as defined in PEP302. The former pre-dates the later. I use custom PEP302 loaders all the time and they work fine in at least 2.6, 2.7 and 3.2. Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r

Code War at PyCon Au 2011

2011-08-01 Thread Ryan Kelly
A huge hit at PyCon-Au last year, Code War is back! Eight teams, onstage knockout rounds of short programming bouts, loud crowd...mildly impressive prizes. Any language allowed, no holds bared. Think of it like cage fighting for coders. Originally based on an idea from the book PeopleWare,

PyCon Australia 2011: Registration Back Online

2011-07-28 Thread Ryan Kelly
/ Silver: Bitbucket by Atlassianhttp://bitbucket.org/ Silver: Microsoft http://www.microsoft.com/ Thanks also to Linux Australia, who provide the overarching legal and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- http

PyCon Australia 2011: Registration Back Online

2011-07-27 Thread Ryan Kelly
/ Silver: Bitbucket by Atlassianhttp://bitbucket.org/ Silver: Microsoft http://www.microsoft.com/ Thanks also to Linux Australia, who provide the overarching legal and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- http

PyCon Australia 2011: Registration Deadlines

2011-07-23 Thread Ryan Kelly
and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

PyCon Australia 2011: Registration Deadlines

2011-07-23 Thread Ryan Kelly
and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- http://mail.python.org/mailman/listinfo/python-list

Re: Inconsistencies between zipfile and tarfile APIs

2011-07-21 Thread Ryan Kelly
. (There may even be the start of one in the bugtracker somewhere, I don't recall...) Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description

PyCon Australia 2011: Schedule Announced

2011-07-13 Thread Ryan Kelly
Development (Malcolm Tredinnick) Benchmarking stuff made ridiculously easy (Tennessee Leeuwenburg) Bytecode: What, Why, and How to Hack it (Ryan Kelly) Developing Scientific Software in Python (Duncan Gray) Fun with App Engine 1.5.0 (Greg Darke) Hosting Python Web Applications

[issue12483] CThunkObject_dealloc should call PyObject_GC_UnTrack?

2011-07-03 Thread Ryan Kelly
New submission from Ryan Kelly r...@rfk.id.au: According to the docs here: http://docs.python.org/c-api/gcsupport.html Any object that uses PyObject_GC_Track in its constructor must call PyObject_GC_UnTrack in its deallocator. The CThunkObject in _ctypes does the former but not the later

PyCon Australia 2011: Sprints

2011-06-29 Thread Ryan Kelly
://www.wingware.com/ Silver: Superior Recruitment http://superiorrecruitment.com.au/ Thanks also to Linux Australia, who provide the overarching legal and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- http://mail.python.org/mailman/listinfo

PyCon Australia 2011: Sprints

2011-06-29 Thread Ryan Kelly
://www.wingware.com/ Silver: Superior Recruitment http://superiorrecruitment.com.au/ Thanks also to Linux Australia, who provide the overarching legal and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- http://mail.python.org/mailman/listinfo

Re: doing cross platform file work

2011-06-23 Thread Ryan Kelly
of other sources. Even if you only ever intend to access local files, I find the API provided by PyFilesystem much nicer than using the various modules from the stdlib. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au

PyCon Australia 2011: Early Bird Closing Soon

2011-05-28 Thread Ryan Kelly
: Standard Talks: A Python on the Couch (Mark Rees) Behaviour Driven Development (Malcolm Tredinnick) Benchmarking stuff made ridiculously easy (Tennessee Leeuwenburg) Bytecode: What, Why, and How to Hack it (Ryan Kelly) Developing Scientific Software in Python (Duncan Gray

PyCon Australia 2011: Early Bird Closing Soon

2011-05-28 Thread Ryan Kelly
: Standard Talks: A Python on the Couch (Mark Rees) Behaviour Driven Development (Malcolm Tredinnick) Benchmarking stuff made ridiculously easy (Tennessee Leeuwenburg) Bytecode: What, Why, and How to Hack it (Ryan Kelly) Developing Scientific Software in Python (Duncan Gray

Re: Python's super() considered super!

2011-05-27 Thread Ryan Kelly
this, of course... Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed message part -- http://mail.python.org/mailman/listinfo

Re: Read-write lock for Python

2011-04-28 Thread Ryan Kelly
about likely to work but if it doesn't, I'd like to hear about it so I can fix it :-) `pip install threading2` Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details

PyCon Australia 2011: cfp closing soon!

2011-04-28 Thread Ryan Kelly
also to Linux Australia, who provide the overarching legal and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- http://mail.python.org/mailman/listinfo/python-list

Re: minimal python27.dll?

2011-04-27 Thread Ryan Kelly
of functionality. Was this ever true, and is it still? Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed message part

PyCon Australia 2011: registrations now open

2011-04-20 Thread Ryan Kelly
, who provide the overarching legal and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

PyCon Australia 2011: registrations now open

2011-04-20 Thread Ryan Kelly
, who provide the overarching legal and organisational structure for PyCon Australia. Ryan Kelly PyCon Australia 2011 -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic infinite for loop?

2011-04-14 Thread Ryan Kelly
= [parse_kwdlist(dct[k]) for k in sorted(dct.keys()) if k.startswith(Keyword)] Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details

Re: Pythonic infinite for loop?

2011-04-14 Thread Ryan Kelly
On Fri, 2011-04-15 at 12:34 +1000, Ryan Kelly wrote: On Fri, 2011-04-15 at 12:10 +1000, Chris Angelico wrote: My first draft looks something like this. The input dictionary is called dct, the output list is lst. lst=[] for i in xrange(1,1000): # arbitrary top, don't like

Re: Egos, heartlessness, and limitations

2011-04-13 Thread Ryan Kelly
however like all my great brain children this one has been cast aside like a red headed stepchild. I can only imagine the hi-jinx that ensure at your yearly great brain family reunion. Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au

Re: Egos, heartlessness, and limitations

2011-04-13 Thread Ryan Kelly
On Thu, 2011-04-14 at 11:46 +1000, Chris Angelico wrote: On Thu, Apr 14, 2011 at 11:29 AM, Ryan Kelly r...@rfk.id.au wrote: I weep that your delightful rhetoric is limited to this neglected forum, where the guardians of python core deign not to tread, and hence denied its rightful place

Re: Egos, heartlessness, and limitations

2011-04-13 Thread Ryan Kelly
On Wed, 2011-04-13 at 19:10 -0700, rantingrick wrote: On Apr 13, 8:29 pm, Ryan Kelly r...@rfk.id.au wrote: On Wed, 2011-04-13 at 17:39 -0700, rantingrick wrote: I would LOVE to improve the doc, however first the student THEN the teacher. However in this forsaken land the teachers do

Re: Egos, heartlessness, and limitations

2011-04-13 Thread Ryan Kelly
On Thu, 2011-04-14 at 03:12 +, Steven D'Aprano wrote: On Thu, 14 Apr 2011 12:03:15 +1000, Ryan Kelly wrote: On Thu, 2011-04-14 at 11:46 +1000, Chris Angelico wrote: On Thu, Apr 14, 2011 at 11:29 AM, Ryan Kelly r...@rfk.id.au wrote: I weep that your delightful rhetoric is limited

[issue10399] AST Optimization: inlining of function calls

2011-04-12 Thread Ryan Kelly
Changes by Ryan Kelly r...@rfk.id.au: -- nosy: +rfk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10399 ___ ___ Python-bugs-list mailing list

[issue11448] docs for HTTPConnection.set_tunnel are ambiguous

2011-03-08 Thread Ryan Kelly
New submission from Ryan Kelly r...@rfk.id.au: The docs for HTTPConnection.set_tunnel(host,port) are ambiguous. They simply say Set the host and the port for HTTP Connect Tunnelling. But should I specify the address of the server *through* which I want to tunnel, or the address

[issue11448] docs for HTTPConnection.set_tunnel are ambiguous

2011-03-08 Thread Ryan Kelly
Ryan Kelly r...@rfk.id.au added the comment: Sorry, endpoint is just a noun that seemed to fit for me, I've no idea if there is a standard term for this. Perhaps origin server if you follow the terminology from the RFC? By way of example, suppose I'm running a proxy on localhost:3128 and I

[issue5091] Segfault in PyObject_Malloc(), address out of bounds

2011-03-06 Thread Ryan Kelly
Ryan Kelly r...@rfk.id.au added the comment: Thanks for the help, I have tracked this down to a bug in PyCrypto. It was increfing an object once but decrefing it twice. Sorry for the noise. -- ___ Python tracker rep...@bugs.python.org http

[issue5091] Segfault in PyObject_Malloc(), address out of bounds

2011-03-05 Thread Ryan Kelly
Ryan Kelly r...@rfk.id.au added the comment: Not sure if it's caused by the same thing, but I just got a segfault on the same line in my own program. Running python 2.7.1. I will try to dig out some more useful info but it's been a long time since I chased a segfault... -- nosy

[issue5091] Segfault in PyObject_Malloc(), address out of bounds

2011-03-05 Thread Ryan Kelly
Ryan Kelly r...@rfk.id.au added the comment: Please remind me how to obtain an appropriate coredump (as I said, it's been a *long* time...) Doing print bp shows an out-of-bounds address as for the original submitter. -- ___ Python tracker rep

[issue5091] Segfault in PyObject_Malloc(), address out of bounds

2011-03-05 Thread Ryan Kelly
Ryan Kelly r...@rfk.id.au added the comment: attaching core dump from a freshly-compiled python 2.7.1 at with -O0 -g in CFLAGS. The code that is segfaulting is using pycrypto and sqlite3, so it may be that a bug in one of these is trampling on something. No idea how to investigate any

Re: Is this a safe use of eval?

2011-02-24 Thread Ryan Kelly
-- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed message part -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a safe use of eval?

2011-02-24 Thread Ryan Kelly
On Thu, 2011-02-24 at 20:13 +1100, Ryan Kelly wrote: On Thu, 2011-02-24 at 10:48 +0200, Frank Millman wrote: Hi all I know that the use of 'eval' is discouraged because of the dangers of executing untrusted code. Here is a variation that seems safe to me, but I could be missing

Re: If/then style question

2010-12-16 Thread Ryan Kelly
. You don't need any further justification for preferring the latter. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description

Re: performance of tight loop

2010-12-13 Thread Ryan Kelly
shows that in Python 3, while 1 and while True are indeed identical. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description

Re: Weird try-except vs if behavior

2010-10-15 Thread Ryan Kelly
= range(1000) try: while True: alist.pop() except IndexError: pass I get the following times for a thousand iterations (not waiting around for a million!) Testing Try 0.224129915237 Testing If 0.300312995911 Cheers, Ryan -- Ryan

Re: Standardizing RPython - it's time.

2010-10-11 Thread Ryan Kelly
zero at the moment... Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed message part -- http://mail.python.org/mailman

[issue9957] SpooledTemporayFile.truncate should take size parameter

2010-09-27 Thread Ryan Kelly
Ryan Kelly r...@rfk.id.au added the comment: I went looking for places to update the documentation but the description of SpooledTemporaryFile doesn't go into any detail of its methods, so I haven't added anything. New patch fixes some whitespace issues. I'd like to argue that this is a bug

[issue9957] SpooledTemporayFile.truncate should take size parameter

2010-09-27 Thread Ryan Kelly
Changes by Ryan Kelly r...@rfk.id.au: Removed file: http://bugs.python.org/file19027/spooledtemporaryfile_truncate.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9957

[issue9957] SpooledTemporayFile.truncate should take size parameter

2010-09-26 Thread Ryan Kelly
New submission from Ryan Kelly r...@rfk.id.au: Both file.truncate() and StringIO.truncate() accept an optional size parameter to truncate the file to a specific size. SpooledTemporaryFile should accept a similar parameter and pass it on. The only tricky part is that truncate can potentially

Re: Private variables

2010-09-01 Thread Ryan Kelly
['a'].fget.func_closure[0].cell_contents['a'] = 7 c.a 7 Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description

Re: Private variables

2010-09-01 Thread Ryan Kelly
On Thu, 2010-09-02 at 12:06 +1000, Ryan Kelly wrote: On Thu, 2010-09-02 at 11:10 +1000, Rasjid Wilcox wrote: Hi all, I am aware the private variables are generally done via convention (leading underscore), but I came across a technique in Douglas Crockford's book Javascript: The Good

ANN: PyEnchant 1.6.3 - now with OSX!

2010-08-17 Thread Ryan Kelly
loading logic for win32, to ensure that we don't accidentally load older versions of e.g. glib that may be on the DLL search path. * Added function get_enchant_version() to retreive the version string for the underlying enchant library. -- Ryan Kelly http://www.rfk.id.au

Re: Python why questions

2010-08-06 Thread Ryan Kelly
in general - it's just one of those things that you have to deal with. But show me a language where floats don't have this problem. And we wonder why kids don't want to learn to program. Yeah, obscure language warts, that must be the reason. Note to self: DNFTT... Ryan -- Ryan Kelly

Re: subprocess escaping POpen?!

2010-08-05 Thread Ryan Kelly
also does this, which suggests that it's considered more secure. No idea why, but I trust the authors of SSH to know their stuff in this regard. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au

Re: sending a file chunk by chunk instead as a whole to a web server

2010-08-02 Thread Ryan Kelly
) ...etc... ...etc... There are many improvements to make, but this should get you started. For example, you'll need to calculate the total content-length rather than just calling len(body) to obtain it. That's left as an exercise to the reader. Ryan -- Ryan Kelly http

[issue9316] typos in zipimport docstrings

2010-07-20 Thread Ryan Kelly
New submission from Ryan Kelly r...@rfk.id.au: zipimporter methods is_package, get_code and get_source have in the their docstring Raise ZipImportError is the module couldn't be found. The attached patch fixes the typo to if the module couldn't be found. -- files

[issue9238] zipfile incorrectly documented as not supporting archive comments

2010-07-12 Thread Ryan Kelly
New submission from Ryan Kelly r...@rfk.id.au: The zipfile module is prominently documented as This module does not currently handle...ZIP files which have appended comments. But as far as I can tell, it handles them fine - there's even a comment property on the ZipFile object that you can

[issue9239] zipfile: truncating comment can corrupt the zipfile

2010-07-12 Thread Ryan Kelly
New submission from Ryan Kelly r...@rfk.id.au: If you open a ZipFile in append mode and modify the comment to be shorter than what was originally there, the file will become corrupted. Truncated data from the original comment is left dangling at the end of the zipfile. A much more trivial

[issue5950] Make zipimport work with zipfile containing comments

2010-07-12 Thread Ryan Kelly
Ryan Kelly r...@rfk.id.au added the comment: I can't imagine anyone depending on this lack-of-feature, but there's no arguing with the technicality of it. One more small incentive to make the jump to Python 3 then. Anyway, I've revisited the patch to clean up the logic and control flow

[issue5950] Make zipimport work with zipfile containing comments

2010-07-12 Thread Ryan Kelly
Changes by Ryan Kelly r...@rfk.id.au: Removed file: http://bugs.python.org/file17944/zipimport_with_comments.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5950

[issue5950] Make zimport work with zipfile containing comments

2010-07-11 Thread Ryan Kelly
Changes by Ryan Kelly r...@rfk.id.au: -- nosy: +rfk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5950 ___ ___ Python-bugs-list mailing list

[issue5950] Make zimport work with zipfile containing comments

2010-07-11 Thread Ryan Kelly
Ryan Kelly r...@rfk.id.au added the comment: Attached is my attempt at a patch for this functionality, along with some simple tests. This basically mirrors what's done in zipfile.py, searching backwards through the file until it finds the end-of-central-directory marker. It tries

[issue5950] Make zimport work with zipfile containing comments

2010-07-11 Thread Ryan Kelly
Ryan Kelly r...@rfk.id.au added the comment: Whoops, forgot to remove the line from the docs about comments not being supported. Updated the patch accordingly. -- Added file: http://bugs.python.org/file17944/zipimport_with_comments.patch ___ Python

[issue5950] Make zimport work with zipfile containing comments

2010-07-11 Thread Ryan Kelly
Changes by Ryan Kelly r...@rfk.id.au: Removed file: http://bugs.python.org/file17943/zipimport_with_comments.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5950

[issue8400] zipimporter find_module fullname mis-documented

2010-07-07 Thread Ryan Kelly
Ryan Kelly r...@rfk.id.au added the comment: Was also just bitten by this, trying to muck with PEP-302-style import hooks. Note that the documented behaviour of zipimporter is also the behaviour required by PEP 302, i.e. full dotted module name. -- nosy: +rfk

Re: A question about the posibility of raise-yield in Python

2010-07-01 Thread Ryan Kelly
. I've tried my hand at implementing the condition/handler/restart paradigm of common lisp, which is very similar to what you describe. You might find it useful: http://pypi.python.org/pypi/withrestart/ Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally

Re: Lockless algorithms in python (Nothing to do with GIL)

2010-06-28 Thread Ryan Kelly
and being used; the other will be discarded and garbage-collected. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally

Re: Lockless algorithms in python (Nothing to do with GIL)

2010-06-28 Thread Ryan Kelly
reading this should even consider using that PretendLock class for anything. It's just an example of how to use setdefault as a test-and-set kind of operator. Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au

Re: Lockless algorithms in python (Nothing to do with GIL)

2010-06-28 Thread Ryan Kelly
= ctypes.c_int.in_dll(ctypes.pythonapi,_Py_Ticker) ticker.value = 0x7fff Or does ctypes muck with the GIL in a way that would break this idea? Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg

Re: Possible to reach back in stack and grab calling function's locals()?

2010-06-17 Thread Ryan Kelly
away with it for purely internal code (heck, even the standard library uses sys._getframe on occasion!) but I would hesitate to have a public-facing API that snaffles locals from any function that happens to call it. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message

ANN: esky 0.7.0

2010-05-29 Thread Ryan Kelly
. * more robust support for the various bundle_files options. Downloads: http://pypi.python.org/pypi/esky/0.7.0/ Code, bugs, etc: http://github.com/rfk/esky/ Tutorial: http://github.com/rfk/esky/tree/master/tutorial/ -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed

Re: Code redundancy

2010-04-21 Thread Ryan Kelly
the with statement in javascript (I assume it's similar to Visual Foxpro). But don't use this in any real code. Seriously, don't even think about it. You don't want to know the kind of abuses that go on under the covers to make this kind of syntax hacking work... Cheers, Ryan -- Ryan Kelly

Re: withhacks module (Re: Code redundancy)

2010-04-21 Thread Ryan Kelly
, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details -- http://mail.python.org/mailman/listinfo/python-list

Re: when should I explicitely close a file?

2010-04-13 Thread Ryan Kelly
besides possibly throwing an exception (e.g. if the script didn't have write access to the current directory). Actually, it will create the file if it doesn't exist, and truncate it to zero length if it does. Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed

ANN: esky 0.5.0

2010-03-15 Thread Ryan Kelly
: http://github.com/rfk/esky/ Tutorial: http://github.com/rfk/esky/tree/master/tutorial/ -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details -- http://mail.python.org/mailman/listinfo

Re: sqlite savepoint problem [solved]

2010-03-15 Thread Ryan Kelly
confident that I won't have time to do one up anytime soon :-) Good luck with your project! Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description

Re: sqlite3 is sqlite 2?

2010-03-14 Thread Ryan Kelly
'2.4.1' sqlite3.sqlite_version '3.6.16' So this is pysqlite version 2.4.1, which wraps sqlite version 3.6.16. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details

Re: sqlite savepoint problem (was: Re: sqlite3 is sqlite 2?)

2010-03-14 Thread Ryan Kelly
out :-) When debugging strange transaction behaviour, I find it easiest to create the connection with isolation_level=None so that are no implicit transactions being created behind your back. Not sure why, but setting this makes your example work for me. Ryan -- Ryan Kelly http

Re: sqlite savepoint problem

2010-03-14 Thread Ryan Kelly
-- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed message part -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite savepoint problem

2010-03-14 Thread Ryan Kelly
in Thread2. You'll see that the delete is immediately committed and the rows cannot be read back by Thread1. (modified version attached for convenience). Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http

ANN: esky v0.4.0

2010-02-25 Thread Ryan Kelly
) Downloads: http://pypi.python.org/pypi/esky/0.4.0/ Code, bugs, etc: http://github.com/rfk/esky/ Tutorial: http://github.com/rfk/esky/tree/master/tutorial/ -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings

Re: Upgrading Py2exe App

2010-02-24 Thread Ryan Kelly
On Wed, 2010-02-24 at 15:05 -0800, Aahz wrote: In article mailman.2807.1266614926.28905.python-l...@python.org, Ryan Kelly r...@rfk.id.au wrote: Yes. The idea of having a bootstrapping exe is that actual application code can be swapped out without having to overwrite the executable file

ANN: esky v0.4.0 [was Re: Upgrading Py2exe App]

2010-02-22 Thread Ryan Kelly
://github.com/rfk/esky/ Tutorial: http://github.com/rfk/esky/tree/master/tutorial/ -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed

Re: Overcoming python performance penalty for multicore CPU

2010-02-21 Thread Ryan Kelly
on a dual-core linux system: http://www.rfk.id.au/blog/entry/a-gil-adventure-threading2 Short story: a particular test suite of mine used to run in around 25 seconds, but a bit of ctypes magic to set thread affinity dropped the running time to under 13 seconds. Cheers, Ryan -- Ryan Kelly

Re: Overcoming python performance penalty for multicore CPU

2010-02-21 Thread Ryan Kelly
. -- Ran 1 test in 3.792s Again, best of five. The variability in times here is much lower - I never saw it go above 4 seconds. CPU usage is consistently 100%. Cheers, Ryan -- Ryan Kelly http

Re: Is there a way to continue after an exception ?

2010-02-20 Thread Ryan Kelly
, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed message part -- http://mail.python.org/mailman/listinfo/python-list

Re: Upgrading Py2exe App

2010-02-19 Thread Ryan Kelly
On Thu, 2010-02-18 at 20:32 -0800, CM wrote: On Feb 18, 7:19 pm, Ryan Kelly r...@rfk.id.au wrote: On Thu, 2010-02-18 at 07:46 -0800, T wrote: I have a Python app which I converted to an EXE (all files separate; single EXE didn't work properly) via py2exe - I plan on distributing

Re: Upgrading Py2exe App

2010-02-19 Thread Ryan Kelly
On Fri, 2010-02-19 at 11:08 -0800, T wrote: On Feb 18, 7:19 pm, Ryan Kelly r...@rfk.id.au wrote: On Thu, 2010-02-18 at 07:46 -0800, T wrote: I have a Python app which I converted to an EXE (all files separate; single EXE didn't work properly) via py2exe - I plan on distributing

Re: Upgrading Py2exe App

2010-02-18 Thread Ryan Kelly
at the moment, the next release will hopefully come with a short tutorial (as well as support for cx_freeze and maybe py2app, depending on how adventurous I'm feeling). Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au

Re: Python's Reference And Internal Model Of Computing Languages

2010-02-02 Thread Ryan Kelly
curious now - what little sprinkle of magic fairy dust has earned JavaScript objects the Xah Lee seal of approval while Python objects miss out? Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg

Re: Why this error message

2010-01-31 Thread Ryan Kelly
): File C:\Python26\Classes_and_OOP_Programing.py, line 145, in module test() NameError: name 'test' is not defined Based on the indentation, it looks like you've defined test as a method on the SpecialFile class. Try dedenting it to begin in the first column. Ryan -- Ryan Kelly

Re: ANN: withrestart 0.2.1

2009-12-18 Thread Ryan Kelly
Not having to pass status flags or callback functions through every layer of your API to properly recover from errors: tryexcept:impossible :-( withrestart: priceless :-) Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r

Re: shouldn't list comprehension be faster than for loops?

2009-12-18 Thread Ryan Kelly
-- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed message part -- http://mail.python.org/mailman/listinfo/python-list

ANN: withrestart 0.2.1

2009-12-17 Thread Ryan Kelly
)) ... 33 By splitting the responsibility for error recovery between Handlers and Restarts, we can cleanly separate the low-level mechanics of recovering from an error from the high-level decisions about what sort of recovery to perform. -- Ryan Kelly http://www.rfk.id.au | This message

Re: ANN: esky 0.2.1

2009-11-13 Thread Ryan Kelly
on in the end? I'm curious it see if esky could easily switch between different freezers (although it currently depends on some rather deep details of the bbfreeze format). Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au

Re: ANN: esky 0.2.1

2009-11-12 Thread Ryan Kelly
into distribution mechanisms, and I passed over bbfreeze because I saw no indication that Python 2.6 was supported. Not sure if it's officially supported, but I do most of my development on Python 2.6 and bbfreeze hasn't given me any problems as yet. Cheers, Ryan -- Ryan Kelly http

ANN: esky 0.2.1

2009-11-07 Thread Ryan Kelly
-ordered sequence of atomic renames on POSIX, using MoveFileTransacted on Windows Vista or later, and using the rename-and-pray method on older versions of Windows. Failed or partial updates are detected and cleaned up automatically. Enjoy! Ryan -- Ryan Kelly http://www.rfk.id.au

Re: comparing alternatives to py2exe

2009-11-03 Thread Ryan Kelly
- although I haven't tried it out, the latest version of bbfreeze claims to support OSX. Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description

Re: recommendation for webapp testing?

2009-09-22 Thread Ryan Kelly
experiences with it. The current version is a little on the slow side, but I believe there's a big new release just around the corner that contains significant performance improvements. Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au

Re: Granularity of OSError

2009-09-18 Thread Ryan Kelly
this. It's slightly clearer to use 'if e.errno == errno.ENOENT' in my opinion, but, whatever. In some cases it's also more correct. While ENOENT is always 2, some error codes differ between windows and posix. In general it's better to use the constants from the errno module. Ryan -- Ryan

[issue6915] os.listdir inconsistenly releases the GIL on win32

2009-09-14 Thread Ryan Kelly
New submission from Ryan Kelly r...@rfk.id.au: The win32 implementation of os.listdir() releases the GIL around calls to FindNextFile, but not around calls to FindFirstFile. Attached is a simple patch to consistently release the GIL around any such calls. -- components: None files

  1   2   >