Re: [Python-Dev] Functions that steal references (Re: [pygame] [patch] minor memory leaks...)

2009-06-17 Thread Hrvoje Niksic

Christian Heimes wrote:

I assumed that since PyModule_AddObject is documented as stealing a
reference, it always stole a reference. But in reality it only does so
conditionally, when it succeeds.

As an aside, is this a general feature of functions
that steal references, or is PyModule_AddObject an
oddity?


IIRC, It's an oddity.


But it is a convenient oddity nonetheless.


Stealing references is sometimes convenient, but Greg was referring to 
functions that steal references *conditionally*, which is indeed an 
oddity.  Most functions and macros that steal references do so 
unconditionally, typically because they can't fail anyway.  Conditional 
stealing of references requires very careful thinking on the side of 
callers that care about not leaking references in the face of 
exceptions.  See http://bugs.python.org/issue1782 for an example.

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Python script language or not

2009-06-17 Thread abhishek goswami

Hi,
I have very basic question about Python that do we consider pyhton as script 
language.
I searched in google but it becomes more confusion for me. After some analysis 
I came to know that Python support oops .

Can anyone clarify me. Please let me know also it is right forum or not. 

I was looking for Python forum but i did not find any forum. Do we have forum 
like
linux forum so it will be very easy for me to ask this question in forum and i 
will not ask
repeated question becuase i am sure this question may be raised before

Abhishek Goswami

Chennai

Phone No -0996227099


  Love Cricket? Check out live scores, photos, video highlights and more. 
Click here http://cricket.yahoo.com___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python script language or not

2009-06-17 Thread Dirkjan Ochtman
On Wed, Jun 17, 2009 at 12:27, abhishek goswami wrote:
> Can anyone clarify me. Please let me know also it is right forum or not.

This is not the right forum. This mailing list is about developing the
CPython interpreter.

For general questions, you may want to try the comp.lang.python newsgroup.

Cheers,

Dirkjan
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] CPython in the web browser under Native Client

2009-06-17 Thread tav
Hey Mark,

> http://lackingrhoticity.blogspot.com/2009/06/python-standard-library-in-native.html

Really glad to see that you carried on with this -- great work!!

I guess the elders will simply say that it's history repeating itself,
but Grails 2.0 is looking promising! We can finally give that upstart
Javascript a run for its money (despite ES5 looking nice...) -- not to
mention Google Wave/Opera Unite/etc.

Now, the real blocker is accessing the DOM from Python. I haven't
looked into the source code deeply, but perhaps Kroll could be of
help:

* http://github.com/jhaynie/kroll/tree/master

I was able to do the following with Titanium Desktop (which uses it)
to access the DOM from Python:


  def hello(s):
  document.getElementById('foo').innerHTML = s

 Hello World
hello("tav")

More relevant links:

* http://www.appcelerator.com/
* http://github.com/appcelerator/

Anyways, I'm sure others might have a better idea of integrating
Python and the DOM.

Well done again!

-- 
love, tav

plex:espians/tav | [email protected] | +44 (0) 7809 569 369
http://tav.espians.com | http://twitter.com/tav | skype:tavespian
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python script language or not

2009-06-17 Thread Terry Reedy

Dirkjan Ochtman wrote:

On Wed, Jun 17, 2009 at 12:27, abhishek goswami wrote:

Can anyone clarify me. Please let me know also it is right forum or not.


This is not the right forum. This mailing list is about developing the
CPython interpreter.

For general questions, you may want to try the comp.lang.python newsgroup.


Or the python-list mailing list, or the gmane.comp.python.general 
newsgroup mirror at gmane.org (free).


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] SSL Certificate Validation

2009-06-17 Thread Bill Janssen
Bill Janssen  wrote:

> > Does it check that the host the socket is connected to is the same as
> > what's given in the CN field in the certificate?
> 
> No.  That, in general, doesn't work very well.  The IETF working group
> on this is considering deprecating putting a hostname in the CN field at
> all, and just adding hostnames via the subjectAltName extension.  The
> problem that's come up is that many computers don't have fixed IP
> addresses, and even with that the hostname is part of a different
> mapping of hostnames to IP addresses, which can also vary.

Incidentally, the current working draft on this seems to be at
.

Bill
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] SSL Certificate Validation

2009-06-17 Thread Bill Janssen
Martin v. Löwis  wrote:

> FWIW, I actually don't know the answer for sure, either, so I would have
> to research this myself, too. In any case, _ssl.c is *not* the place
> where any of the certificate validation actually happens - nor does it
> happen elsewhere in the Python source code, IIUC.

Strictly speaking, that's right.  It's all done by OpenSSL.

Bill
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] SSL Certificate Validation

2009-06-17 Thread Devin Cook
Ok, thanks for all the feedback. Just for clarity, I'll summarize
everything as I understand it:

* OpenSSL does the all validation of the certificate itself.
(http://openssl.org/docs/apps/verify.html)
* httplib should have a way to enable validation of the certificate.
* httplib should have a way to enable checking of the reference
identity. (that complies with section 3 of this draft:
http://tools.ietf.org/html/draft-saintandre-tls-server-id-check-00)
* The reference identity checking (and cert validation, I assume)
shouldn't be automatic. (per Bill)

Does that sound about right? I'll try to work up a patch tonight
implementing this.

-Devin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] SSL Certificate Validation

2009-06-17 Thread Bill Janssen
I think if you check the issue tracker, there's already a patch for this
somewhere, IIRC.

Bill

Devin Cook  wrote:

> Ok, thanks for all the feedback. Just for clarity, I'll summarize
> everything as I understand it:
> 
> * OpenSSL does the all validation of the certificate itself.
> (http://openssl.org/docs/apps/verify.html)
> * httplib should have a way to enable validation of the certificate.
> * httplib should have a way to enable checking of the reference
> identity. (that complies with section 3 of this draft:
> http://tools.ietf.org/html/draft-saintandre-tls-server-id-check-00)
> * The reference identity checking (and cert validation, I assume)
> shouldn't be automatic. (per Bill)
> 
> Does that sound about right? I'll try to work up a patch tonight
> implementing this.
> 
> -Devin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-17 Thread Greg Ewing

Cameron Simpson wrote:


But people not using threads, or at any rate not
dedicating a thread to the reading task, don't have such luxury.


But without a dedicated thread you need to use
select() or poll(), and then buffering causes other
headaches.


Are we disputing the utility of being able to ask "how much might I
read/peek without blocking"?


I'm saying that I don't see how I would make use
of such a thing, so I probably wouldn't mind if
it didn't exist.


Or disputing the purpose of peek, which
feels to me like it should/might ask that question, but doesn't.


I think what I'm saying is that there are two
distinct use cases being talked about for a peek-like
operation, and different people seem to have different
ideas on which one should be mapped to the name "peek".
So perhaps they should both be given more-explicit
names.


It's perfectly possible, even reasonable, to avoid talking about the
buffer at all. I'd be happy not to mention the buffer.


Even if you don't mention it explicitly, its
existence shows through in the fact that there
is an arbitrary limit on the amount you can
peek ahead, and that limit needs to be documented
so that people can write correct programs.

This is true of both kinds of peeking, so I
concede that they both break the abstraction.

However I think the non-blocking peek breaks it
more than the blocking one, because it also
brings non-deterministic behaviour.

--
Greg
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com