[issue18170] define built-in exceptions in Python code

2016-09-25 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes
versions: +Python 3.7 -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18170] define built-in exceptions in Python code

2013-06-15 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18170
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18170] define built-in exceptions in Python code

2013-06-14 Thread Chris Rebert

Changes by Chris Rebert pyb...@rebertia.com:


--
nosy: +cvrebert

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18170
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18170] define built-in exceptions in Python code

2013-06-09 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I suppose you'd better hope that there are no errors loading said frozen 
module. :)

--
nosy: +benjamin.peterson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18170
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18170] define built-in exceptions in Python code

2013-06-09 Thread Brett Cannon

Brett Cannon added the comment:

Yeah, that's the tricky bit. =) That's why I was thinking of starting with the 
leaf exceptions and then just slowly working down the hierarchy until I hit 
exceptions that just had to exist in C code (e.g. BaseException, Exception, and 
maybe SyntaxError). The rest could be made fake with Exception to start and 
then replace after the module was loaded.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18170
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18170] define built-in exceptions in Python code

2013-06-08 Thread Brett Cannon

New submission from Brett Cannon:

This quite possibly won't work because of performance, but I have been 
wondering how feasible it would be to define as many core exception types as 
possible in pure Python code and then freeze the module for loading. It would 
have the benefit of making maintenance easier (e.g. all of the PEP 3151 
exceptions would have been simpler to add). It also would make it easier on 
other VMs by minimizing the number of exceptions that have to be written in 
their implementation language.

Implementation-wise, it's probably easiest to start with leaf exceptions in the 
inheritance hierarchy and then slowly port more and more. Any exceptions ported 
to pure Python would have their PyExc_* variable set to their parent so that 
the variable is initialized to some exception before any Python code is 
touched. The real trick will come down to dealing with situations where some 
specific C API has been exposed (e.g. UnicodeError).

Even if this experiment turns out to be feasible and reasonable in terms of 
simplifying C code, the other question is performance. If this costs more than 
a couple percent of overall performance (and quite possibly not even at that 
expense) this would not be worth it.

--
components: Interpreter Core
messages: 190837
nosy: brett.cannon
priority: low
severity: normal
stage: needs patch
status: open
title: define built-in exceptions in Python code
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18170
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com