exit code of a script that raises an Exception?

2014-09-09 Thread thequietcenter
Hello, after looking at the docs for Exception:
https://docs.python.org/2/library/exceptions.html

I do not see any information on the guaranteed exit code a script that exits 
because Python threw an exception.

I wonder if all exceptions throw the exact same non-zero exit code, or whether 
a specific exit code is assigned to each exception uniquely. Or whether the 
exit code behavior is undefined (especially since it appears to be 
undocumented).

Thanks,
Terrence
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to create python web framework for ERP

2014-09-09 Thread thequietcenter
On Tuesday, September 9, 2014 6:53:37 AM UTC-4, Adam Nešpůrek wrote:
  I would highly recommend to stick around Django, because of its huge 
 ecosystem.

Django's ORM layer does not perform intelligent object creation does it? It 
naively creates two instances for the same row and does not handle commits 
gracefully, often resulting in stale object errors?

it's been awhile since I used it. But I think SQLAlchemy has solved all the 
problems the Django ORM has not and can't solve?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [ANN] pathlib 1.0.1

2014-09-09 Thread thequietcenter
On Wednesday, September 3, 2014 11:58:47 AM UTC-4, Antoine Pitrou wrote:

 
 pathlib offers a set of classes to handle filesystem paths.  

How does it differ from path.py?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: exit code of a script that raises an Exception?

2014-09-09 Thread thequietcenter
On Tuesday, September 9, 2014 9:56:04 AM UTC-4, thequie...@gmail.com wrote:

 I wonder if all exceptions throw the exact same non-zero exit code, or 
 whether a specific exit code is assigned to each exception uniquely. Or 
 whether the exit code behavior is undefined (especially since it appears to 
 be undocumented).
 

Just found sys.excepthook. I see that there is no sys.exit() call in its 
documented behavior: https://docs.python.org/2/library/sys.html


sys.excepthook(type, value, traceback)
This function prints out a given traceback and exception to sys.stderr.

When an exception is raised and uncaught, the interpreter calls sys.excepthook 
with three arguments, the exception class, exception instance, and a traceback 
object. In an interactive session this happens just before control is returned 
to the prompt; in a Python program this happens just before the program exits. 
The handling of such top-level exceptions can be customized by assigning 
another three-argument function to sys.excepthook.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Object Systems

2014-08-13 Thread thequietcenter
On Wednesday, August 13, 2014 4:32:04 AM UTC-4, Michele Simionato wrote:
 Years ago I wrote strait: https://pypi.python.org/pypi/strait

What is the difference between traits and roles?
-- 
https://mail.python.org/mailman/listinfo/python-list


Python Object Systems

2014-08-11 Thread thequietcenter
(Cross-posted from 
http://www.reddit.com/r/Python/comments/2d9f7i/survey_of_python_object_systems/)

Hello, has anyone created a survey of Python Object Systems? The two I am aware 
of are:

- elk https://github.com/frasertweedale/elk
- Traits http://code.enthought.com/projects/traits/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Object Systems

2014-08-11 Thread thequietcenter
On Monday, August 11, 2014 4:37:29 PM UTC-4, Skip Montanaro wrote:
 On Mon, Aug 11, 2014 at 3:26 PM,  thequietcen...@gmail.com wrote:
 
  has anyone created a survey of Python Object Systems?
 
 
 
 For the uninitiated, can you back up a step and define what you mean
 
 by an object system? 

I mean a system by which one creates and manages Python objects. For instance, 
Python ships with an object system as documented here:
https://docs.python.org/2/tutorial/classes.html

However, some developers have found the need to add features to the standard 
Python object system (e.g. delegation, typing, etc), thus offering a new object 
system.

So far, the following object systems have been found:

* elk https://github.com/frasertweedale/elk
* Traits http://code.enthought.com/projects/traits/
* yuppy https://github.com/kuujo/yuppy

-- Terrence
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Object Systems

2014-08-11 Thread thequietcenter
On Monday, August 11, 2014 5:09:35 PM UTC-4, Marko Rauhamaa wrote:

 
 Elk and Traits implement a C++-style object model on top of Python. The
 
 systems enforce member access, type constraints etc and result in ugly
 
 code that barely looks like Python.

I personally get tired of manually assigning attributes in a __init__() method. 
So at the bare minimum something like Atom will do if nothing else:

https://github.com/nucleic/atom

And I imagine yuppy would make you upchuck as well:
https://github.com/kuujo/yuppy
-- 
https://mail.python.org/mailman/listinfo/python-list