[Python-Dev] Runtime forks through monkeypatching (was Re: Use function names instead of functions for os.supports_dir_fd?)

2012-07-19 Thread Nick Coghlan
On Fri, Jul 20, 2012 at 4:48 AM, Antoine Pitrou wrote: > On Wed, 18 Jul 2012 02:26:14 +0200 > Victor Stinner wrote: > >> >> Monkey patching is a common practice in Python. test_os.py replaces >> >> os.exec*() functions temporary for example. >> > >> > Perhaps for testing, but I don't think monkey

Re: [Python-Dev] Unbinding of methods

2012-07-19 Thread M Stefan
On 7/19/2012 9:54 PM, Antoine Pitrou wrote: On Thu, 19 Jul 2012 19:53:27 +0300 M Stefan wrote: Hey, As part of pickle4, I found it interesting to add the possibility of pickling bound functions (instance methods). This is done by pickling f.__self__ and f.__func__ separately, and then adding a

Re: [Python-Dev] Unbinding of methods

2012-07-19 Thread Richard Oudkerk
On 19/07/2012 7:54pm, Antoine Pitrou wrote: > Instead of a specific opcode, can't you use a suitable __reduce__ > magic (or __getnewargs__, perhaps)? We want to limit the number of > opcodes except for performance-critical types (and I don't think > bound methods are performance-critical for the p

Re: [Python-Dev] Unbinding of methods

2012-07-19 Thread Antoine Pitrou
On Thu, 19 Jul 2012 19:53:27 +0300 M Stefan wrote: > Hey, > > As part of pickle4, I found it interesting to add the possibility > of pickling bound functions (instance methods). This is done by > pickling f.__self__ and f.__func__ separately, and then adding > a BIND opcode to tie them together.

Re: [Python-Dev] Use function names instead of functions for os.supports_dir_fd?

2012-07-19 Thread Antoine Pitrou
On Wed, 18 Jul 2012 02:26:14 +0200 Victor Stinner wrote: > >> Monkey patching is a common practice in Python. test_os.py replaces > >> os.exec*() functions temporary for example. > > > > Perhaps for testing, but I don't think monkey-patching is common in > > production code. Perhaps you are think

[Python-Dev] clang

2012-07-19 Thread Antoine Pitrou
On Wed, 18 Jul 2012 17:15:18 +0200 Ronald Oussoren wrote: > > > >> I regularly run the 3.3 testsuite using the latest Xcode from the Appstore > >> on a OSX Lion machine and that works properly. > > > > I'm not actually using the latest Xcode. So if you could test my test > > program, that would

Re: [Python-Dev] Unbinding of methods

2012-07-19 Thread Brett Cannon
The issue is http://bugs.python.org/issue15397 [Stefan accidentally replied privately to me] On Thu, Jul 19, 2012 at 1:00 PM, Brett Cannon wrote: > > > On Thu, Jul 19, 2012 at 12:53 PM, M Stefan wrote: > >> Hey, >> >> As part of pickle4, I found it interesting to add the possibility >> of pickl

Re: [Python-Dev] Unbinding of methods

2012-07-19 Thread Brett Cannon
On Thu, Jul 19, 2012 at 12:53 PM, M Stefan wrote: > Hey, > > As part of pickle4, I found it interesting to add the possibility > of pickling bound functions (instance methods). This is done by > pickling f.__self__ and f.__func__ separately, and then adding > a BIND opcode to tie them together. >

[Python-Dev] Unbinding of methods

2012-07-19 Thread M Stefan
Hey, As part of pickle4, I found it interesting to add the possibility of pickling bound functions (instance methods). This is done by pickling f.__self__ and f.__func__ separately, and then adding a BIND opcode to tie them together. While this appears to work fine for python methods (non-builti

Re: [Python-Dev] venv scripts for fish and csh shells

2012-07-19 Thread Carl Meyer
On 07/19/2012 10:26 AM, Andrew Svetlov wrote: > virtualenv has virtualenv.csh and virtualenv.fish files. > Is there any reason for restricting venv to bash/zsh only? No. As far as I'm concerned, a patch to port the virtualenv csh and fish activate scripts to pyvenv would be welcome (though I can't

Re: [Python-Dev] Why no venv in existing directory?

2012-07-19 Thread Carl Meyer
Hi Stefan, On 07/19/2012 06:28 AM, Stefan H. Holek wrote: > While trying 3.3 beta I found that I cannot use my favorite > virtualenv pattern with pyvenv: > > $ virtualenv . Installing.done. > > $ pyvenv . Error: Directory exists: /Users/stefan/sandbox/foo > > I appreciate that this behavior

[Python-Dev] venv scripts for fish and csh shells

2012-07-19 Thread Andrew Svetlov
virtualenv has virtualenv.csh and virtualenv.fish files. Is there any reason for restricting venv to bash/zsh only? -- Thanks, Andrew Svetlov ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscrib

[Python-Dev] Why no venv in existing directory?

2012-07-19 Thread Stefan H. Holek
Hi All, While trying 3.3 beta I found that I cannot use my favorite virtualenv pattern with pyvenv: $ virtualenv . Installing.done. $ pyvenv . Error: Directory exists: /Users/stefan/sandbox/foo I appreciate that this behavior is documented and was in the PEP from the start: "If