Re: [Python-Dev] Add PEP 444, Python Web3 Interface.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [Python-Dev] Add PEP 444, Python Web3 Interface.

James Mills-3
On Thu, Sep 16, 2010 at 10:02 AM, John Nagle <[hidden email]> wrote:
> On 9/15/2010 4:44 PM, [hidden email] wrote:
>>
>> ``SERVER_PORT`` must be a bytes instance (not an integer).
>
>   What's that supposed to mean?  What goes in the "bytes
> instance"?  A character string in some format?  A long binary
> number?  If the latter, with which byte ordering?  What
> problem does this\ solve?

(Posting to web-sig):

I can see value in this (some-what). There are certain situations
(UNIX Sockets) where
SERVER_PORT is irrelevant and doesn't make sense. In my experience
setting this to
0 or None is probably okay (when it used to be an int). Can't comment
on byte ordering,
or format, etc... Perhaps SERVER_PORT should be left as it was in the
original PEP 333
specs as an int (or None?)

cheers
James

--
-- James Mills
--
-- "Problems are solved by method"
_______________________________________________
Web-SIG mailing list
[hidden email]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/lists%40nabble.com
Reply | Threaded
Open this post in threaded view
|

Re: [Python-Dev] Add PEP 444, Python Web3 Interface.

Chris McDonough
It's, e.g.

b'8080'

.. instead of the integer value 8080.

Apparently the type of this value was not spelled out sufficiently in
the WSGI spec and string values and integer values were used
interchangeably, making it harder to join them with the other values in
the environ (a common thing to want to do).  Bytes instances are
attractive, as the rest of the values are also bytes, so they can be
joined together easily.

(I also redirected this to web-sig at the request of PJE).
       
- C

On Wed, 2010-09-15 at 17:02 -0700, John Nagle wrote:

> On 9/15/2010 4:44 PM, [hidden email] wrote:
> > ``SERVER_PORT`` must be a bytes instance (not an integer).
>
>     What's that supposed to mean?  What goes in the "bytes
> instance"?  A character string in some format?  A long binary
> number?  If the latter, with which byte ordering?  What
> problem does this\ solve?
>
> John Nagle
>
> _______________________________________________
> Python-Dev mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/lists%40plope.com
>


_______________________________________________
Web-SIG mailing list
[hidden email]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/lists%40nabble.com
Reply | Threaded
Open this post in threaded view
|

Re: [Python-Dev] Add PEP 444, Python Web3 Interface.

James Mills-3
On Thu, Sep 16, 2010 at 11:05 AM, Chris McDonough <[hidden email]> wrote:

> It's, e.g.
>
> b'8080'
>
> .. instead of the integer value 8080.
>
> Apparently the type of this value was not spelled out sufficiently in
> the WSGI spec and string values and integer values were used
> interchangeably, making it harder to join them with the other values in
> the environ (a common thing to want to do).  Bytes instances are
> attractive, as the rest of the values are also bytes, so they can be
> joined together easily.

If this is to be "standard" - that is the SERVER_PORT be specified as
bytes representing the numerical port (tcp)
then I support this. In the case of unix sockets it could be a null
byte string, eg: b""

cheers
james


--
-- James Mills
--
-- "Problems are solved by method"
_______________________________________________
Web-SIG mailing list
[hidden email]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/lists%40nabble.com