On Mon, Dec 29, 2014 at 3:14 AM, Mark Lawrence wrote:
>> Is anyone else interested in the patch? Should I create a tracker
>> issue and upload it?
>
> I'd raise a tracker issue so it's easier to find in the future.
http://bugs.python.org/issue23126
ChrisA
--
https://mail.python.org/mailman/list
On 28/12/2014 15:38, Chris Angelico wrote:
On Mon, Dec 29, 2014 at 1:22 AM, Chris Angelico wrote:
I wonder how hard it would be to tinker at the C level and add a
__getattr__ style of hook...
You know what, it's not that hard. It looks largeish as there are four
places where NameError (not co
On Mon, Dec 29, 2014 at 2:38 AM, Chris Angelico wrote:
> It's just like __getattr__: if it returns something, it's as
> if the name pointed to that thing, otherwise it raises NameError.
To clarify: The C-level patch has nothing about imports. What it does
is add a hook at the point where NameErro
On Mon, Dec 29, 2014 at 1:22 AM, Chris Angelico wrote:
> I wonder how hard it would be to tinker at the C level and add a
> __getattr__ style of hook...
You know what, it's not that hard. It looks largeish as there are four
places where NameError (not counting UnboundLocalError, which I'm not
tou
On Mon, Dec 29, 2014 at 1:15 AM, Skip Montanaro
wrote:
>> We were discussing something along these lines a while ago, and I
>> never saw anything truly satisfactory - there's no easy way to handle
>> a missing name by returning a value (comparably to __getattr__), you
>> have to catch it and then
> We were discussing something along these lines a while ago, and I
> never saw anything truly satisfactory - there's no easy way to handle
> a missing name by returning a value (comparably to __getattr__), you
> have to catch it and then try to re-execute the failing code, which
> isn't perfect. H
On Mon, Dec 29, 2014 at 12:58 AM, Skip Montanaro
wrote:
> (Ignore the "autoloading" message. I use an autoloader in interactive
> mode which comes in handy when I forget to import a module, as I did
> here.)
We were discussing something along these lines a while ago, and I
never saw anything trul
Hmmm... Works for me.
% python
Python 2.7.6+ (2.7:db842f730432, May 9 2014, 23:53:26)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> with open("coconutBattery.csv", "rb") as f:
... r = csv.DictReader(
On Sun, 28 Dec 2014 14:41:55 +0200, Jussi Piitulainen wrote:
> Skip Montanaro writes:
>
>> > ValueError: I/O operation on closed file
>> >
>> > Here is my code in a Python shell -
>> >
>> > >>> with open('x.csv','rb') as f:
>> > ... r = csv.DictReader(f,delimiter=",")
>> > >>> r.fieldnames
>>
On Sun, 28 Dec 2014 06:19:58 -0600, Skip Montanaro wrote:
>> ValueError: I/O operation on closed file
>>
>> Here is my code in a Python shell -
>>
>> >>> with open('x.csv','rb') as f:
>> ... r = csv.DictReader(f,delimiter=",")
>> >>> r.fieldnames
>
> The file is only open during the context o
Skip Montanaro writes:
> > ValueError: I/O operation on closed file
> >
> > Here is my code in a Python shell -
> >
> > >>> with open('x.csv','rb') as f:
> > ... r = csv.DictReader(f,delimiter=",")
> > >>> r.fieldnames
>
> The file is only open during the context of the with statement.
> Inde
> ValueError: I/O operation on closed file
>
> Here is my code in a Python shell -
>
> >>> with open('x.csv','rb') as f:
> ... r = csv.DictReader(f,delimiter=",")
> >>> r.fieldnames
The file is only open during the context of the with statement. Indent the
last line to match the assignment to
12 matches
Mail list logo