-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Chris McDonough wrote:
Using an interface class for a constant container would often be handy but
it
might be an inappropriate use of interface classes. FTR, I do often put
constants in an interfaces.py module at module scope (if there are more
Tres Seaver wrote:
Chris McDonough wrote:
Using an interface class for a constant container would often be handy but
it
might be an inappropriate use of interface classes. FTR, I do often put
constants in an interfaces.py module at module scope (if there are more
than
one related,
On Fri, Apr 3, 2009 at 7:21 PM, Wichert Akkerman wich...@wiggy.net wrote:
Previously Chris Rossi wrote:
I was wondering if the Zope collective had given any consideration to
allowing constants to be defined in interfaces. To be clear, these are
constant values that make up the protocol
Using an interface class for a constant container would often be handy but it
might be an inappropriate use of interface classes. FTR, I do often put
constants in an interfaces.py module at module scope (if there are more than
one related, sometimes in a dictionary or within a non-interface class
On Sat, Apr 4, 2009 at 6:04 PM, Chris McDonough chr...@plope.com wrote:
Using an interface class for a constant container would often be handy
but it
might be an inappropriate use of interface classes.
I would argue that it is appropriate, but that's probably related to my
experience with
Chris McDonough wrote:
FTR, I do often put
constants in an interfaces.py module at module scope (if there are more than
one related, sometimes in a dictionary or within a non-interface class
statement) in order to not feel I need to create some constants.py module.
Maybe we could just agree
Chris Rossi wrote:
from zope.interface import Constant
class IHttpResponse(Interface):
Models an HTTP 1.1 response.
HTTP_OK = Constant(200 Ok, An HTTP Ok response.)
HTTP_NOT_FOUND = Constant(404 Not Found, An HTTP Not Found response)
status = Attribute(HTTP status
Hello,
I was wondering if the Zope collective had given any consideration to
allowing constants to be defined in interfaces. To be clear, these are
constant values that make up the protocol defined by the interface. Just to
have a concrete example, let's say we're modeling an http response:
On Apr 3, 2009, at 12:35 PM, Chris Rossi wrote:
Hello,
Hi Chris.
I was wondering if the Zope collective had given any consideration
to allowing constants to be defined in interfaces. To be clear,
these are constant values that make up the protocol defined by the
interface.
...
Previously Chris Rossi wrote:
I was wondering if the Zope collective had given any consideration to
allowing constants to be defined in interfaces. To be clear, these are
constant values that make up the protocol defined by the interface. Just to
have a concrete example, let's say we're
On Apr 3, 2009, at 7:21 PM, Wichert Akkerman wrote:
This looks like a poor man's enum. I'ld prefer to have a proper enum
like thing.
Seems a little different to me.
For what it is worth, though, if you do want an enum in zope.schema,
Canonical has lazr.enum:
11 matches
Mail list logo