Because you are not looking at the rigth object. Users won't use _file
but core::file

On 01/03/2013 03:09, joker-eph wrote:
> In pythran/pythonic++/core/file.h:
> 
>> +
>> +					public:
>> +				typedef core::string value_type;
>> +		        file_iterator(core::file & ref);
>> +        		file_iterator(core::file & ref, core::npos);
>> +        		bool operator==(file_iterator const& f2) const;
>> +		        bool operator!=(file_iterator const& f2) const;
>> +		        bool operator<(file_iterator const& f2) const;
>> +				file_iterator& operator++();
>> +				core::string operator*() const;
>> +			};
>> +
>> +			struct _file{
>> +					FILE* f;
>> +					_file() : f(nullptr) {}
>> +					_file(core::string const& filename, core::string const& strmode = "r") : f(fopen(filename.c_str(), strmode.c_str())){}
> 
> Why not open() in constructor body, and raise an exception here? I think
> that the client shouldn't have to check the success of the construction
> afterward.
> 
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/serge-sans-paille/pythran/pull/53/files#r3199665>.
>