Re: [Python-Dev] Core projects: 3to2

2009-03-19 Thread Terry Reedy

Antoine Pitrou wrote:

Terry Reedy  udel.edu> writes:
Some of the people who need to support both late 2.x and 3.x would 
prefer to write 3.x code and backport.  The OP of a current python-list 
thread asked whether there was any way to write something like


@alias('__nonzero__')
def __bool__(self): return True


How about simply:
__nonzero__ = __bool__


I believe my own 3.0 code will mainly also need
print() to print statement


If this is only about supporting "late 2.x" (i.e., 2.6 and upwards), you can
already write:


People often do not specify.  I suspect some are thinking back to 2.5, 
but that will change in the future.



from __future__ import print_function


I was not aware of that.  Would be ok for my current project which has 
print isolated in a few modules, at least so far.



except e as a to 2.x version


Works in 2.6.


Did not know that.  Perhaps a 3 to 2.6+ guide would help.



class C() to class C(object)


Part of the reason to move to 3.0 is to not have to do that.


__metaclass__ = type

Now I'm not saying that all 3.0 code will work in 2.6 with such simple
precautions, far from it!


tjr

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


[Python-Dev] Security fixes in 2.5 and 2.4

2009-03-19 Thread Martin v. Löwis
I just got a few questions on how to apply security fixes.
To clarify, I recommend the following guidelines:

- whether something constitutes a security bug is sometimes
  debatable - in case of doubt, discussion is needed. I would
  be in favor of fixing it if the patch is small and obviously
  correct, and opposed if the patch looks tricky. Double check
  that the routine behavior (the "good" cases) stay completely
  unchanged (in particular, be aware of not allowing new
  exceptions to occur).
- if you want to backport a security bug fix to 2.5, ALWAYS
  consider 2.4 as well. They are in the same state, and should
  get the same care (2.3 is closed for good). Of course, it
  might be that the bug doesn't exist in 2.4.
- ALWAYS notify secur...@python.org. For one thing, they might
  offer advise on how to proceed, but also, they might consider
  publishing an advisory, and/or notifying some CERT. Notification
  is in particular necessary if you are unfamiliar with security
  issues, how they get classified, and so on - so do ask the
  experts. (and no, I'm not one of them :-)

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Core projects: 3to2

2009-03-19 Thread andrew cooke
Terry Reedy wrote:
> Antoine Pitrou wrote:
>> Terry Reedy  udel.edu> writes:
>>> Some of the people who need to support both late 2.x and 3.x would
>>> prefer to write 3.x code and backport.  The OP of a current python-list
>>> thread asked whether there was any way to write something like
>>>
>>> @alias('__nonzero__')
>>> def __bool__(self): return True
>>
>> How about simply:
>> __nonzero__ = __bool__
>>
>>> I believe my own 3.0 code will mainly also need
>>> print() to print statement
>>
>> If this is only about supporting "late 2.x" (i.e., 2.6 and upwards), you
>> can
>> already write:
>
> People often do not specify.  I suspect some are thinking back to 2.5,
> but that will change in the future.


i am the author of the original post quoted above.  i wrote a parser
library (lepl) using 3.0.  backporting to 2.6 was fairly easy, but it
still does not run with 2.5.

if i remember correctly it appeared that i was going to need separate
source files because of significant differences in syntax (print,
exceptions) as well as missing functionality (metaclasses, string
formatting).

andrew


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


[Python-Dev] snakebite for GSoC?

2009-03-19 Thread ajaksu
Hi,

Does anyone have good ideas for assigning students to snakebite? Is it
too early?

I think the  client-side 'Snakebite daemon' and server-side stuff
described at http://tinyurl.com/beyond-buildbot would be great
projects.

Daniel
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] GSoC ideas in need of mentors :)

2009-03-19 Thread Daniel (ajax) Diniz
Hi,

I'd like to propose a two housecleaning GSoC ideas for discussion,
they both need mentors. First, Mark's suggested overhaul of the struct
module, along with finishing PEP 3118 if possible. Second, a clean up
of the socket module, along with checking its usage in the stdlib if
possible. Details below.

IIUC, any potential mentors for ideas from
http://wiki.python.org/moin/CodingProjectIdeas would help the PSF by
declaring availability at
http://wiki.python.org/moin/SummerOfCode/2009.

And, mentioned in another thread, snakebite ideas:
http://tinyurl.com/beyond-buildbot :)

Regards,
Daniel

---
Overhaul struct + PEP 3118
There are many open issues for the struct module, and a suggestion
that many others fixes should happen. The problems include
inconsistencies in input handling and backwards-compatibility code
that should be gone from 3.x.

As PEP 3118 also requires a few changes in struct, finishing the
memoryview object implementation and backporting it to 2.7 could be
part of this project.

To tackle this, a student should know C and have some familiarity with
the CPython codebase. The proposal should include an overview of open
issues and, if possible, of problems in current code.

Mentors for this task should have a good understanding of the struct
module, the buffer interface and PEP 3118.

---
Clean up and improve the socket module

The socket module is the foundation of many important parts of the
stdlib. It has many open issues and RFEs, with many more being
indirectly dependent on it. Major pain areas are cross-platform
problems, shortcomings for a few use cases and some missing bits from
the API (e.g. recvall(), sendmsg() and recvmsg()). If these can be
solved quickly, going through the uses of the socket module in the
stdlib to would make this project even more useful.

This project has some ugly cross-platform needs, but these can be
handled by the student and the mentor together (maybe snakebite could
help?). For students wanting to work on this, knowing C is a must,
being familiar with CPython and the stdlib would be desirable. Having
some prior knowledge of POSIX and Windows interfaces the socket module
uses would be a nice perk.

Mentors should be able to help the student to test their code on many
different platforms. Knowing the socket API in different platforms
would be desirable.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Core projects for Summer of Code

2009-03-19 Thread Raymond Hettinger
Another thought:  it would be nice is pydoc were built-out with 
an alternate html generator that emitted clean, simple html

with the appropriate div/span tags so that CSS can be used
to control formatting.  Right now, all of the formatting and
color coding is in-line.  If you don't like the appearance of
the output, the module is unusable.  This is likely a two to
three day project, easy and fun.


Raymond
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] tracker status options

2009-03-19 Thread Brett Cannon
On Wed, Mar 18, 2009 at 23:47, "Martin v. Löwis"  wrote:

> > It would be great to put in some of those extra status options that were
> > discussed recently...
> >
> >"Open/New"
> >"Needs help / Chatting"
> >"Under development"
> >"Pending feedback"
> >"Closed"
>
> Are you sure that you want them to be status options? Why not stages?


Because Tennessee is after a way to sift through open issues looking for
ones that are not being actively worked on, thus the "Under Dev" status.
Just because an issue "needs [a] patch" doesn't means it is being worked on
currently.


>
> ISTM that an issue that "Needs help" is still "Open".


Once the backlog of bugs has been cleaned up and we get into a habit of
triaging new bugs as soon as they come in this won't be quite as necessary.
I believe Tennessee wanted this status to signify that more input is needed
from others originally and to perform triage. Out of the two this one is
needed the least in my opinion.

-Brett
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Security fixes in 2.5 and 2.4

2009-03-19 Thread Brett Cannon
On Thu, Mar 19, 2009 at 02:04, "Martin v. Löwis"  wrote:

> I just got a few questions on how to apply security fixes.
> To clarify, I recommend the following guidelines:
>
> - whether something constitutes a security bug is sometimes
>  debatable - in case of doubt, discussion is needed. I would
>  be in favor of fixing it if the patch is small and obviously
>  correct, and opposed if the patch looks tricky. Double check
>  that the routine behavior (the "good" cases) stay completely
>  unchanged (in particular, be aware of not allowing new
>  exceptions to occur).
> - if you want to backport a security bug fix to 2.5, ALWAYS
>  consider 2.4 as well. They are in the same state, and should
>  get the same care (2.3 is closed for good). Of course, it
>  might be that the bug doesn't exist in 2.4.
> - ALWAYS notify secur...@python.org. For one thing, they might
>  offer advise on how to proceed, but also, they might consider
>  publishing an advisory, and/or notifying some CERT. Notification
>  is in particular necessary if you are unfamiliar with security
>  issues, how they get classified, and so on - so do ask the
>  experts. (and no, I'm not one of them :-)


All sounds reasonable, although getting those of us on security@ to get an
announcement out has not gone so well as of late. =)

-Brett
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] tracker status options

2009-03-19 Thread Martin v. Löwis
> On Wed, Mar 18, 2009 at 23:47, "Martin v. Löwis"  > wrote:
> 
> > It would be great to put in some of those extra status options
> that were
> > discussed recently...
> >
> >"Open/New"
> >"Needs help / Chatting"
> >"Under development"
> >"Pending feedback"
> >"Closed"
> 
> Are you sure that you want them to be status options? Why not stages?
> 
> 
> Because Tennessee is after a way to sift through open issues looking for
> ones that are not being actively worked on, thus the "Under Dev" status.
> Just because an issue "needs [a] patch" doesn't means it is being worked
> on currently.

How is "being actively worked on" defined? How do these additional
status values help in answering that question?

> ISTM that an issue that "Needs help" is still "Open".
> 
> 
> Once the backlog of bugs has been cleaned up and we get into a habit of
> triaging new bugs as soon as they come in this won't be quite as
> necessary. I believe Tennessee wanted this status to signify that more
> input is needed from others originally and to perform triage. Out of the
> two this one is needed the least in my opinion.

If you want them, we can add them. However, I would then need a complete
specification of how various pieces that currently refer to Open/Closed
should behave with respect to the new status, such as
- list of issues displayed
- weekly email notifications
- initial value that status should get
- relationship to existing status values

In addition, I would like to see a specification of the exact labels to
be used, plus a one-line description that should be attached to the
labels.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] tracker status options

2009-03-19 Thread Daniel (ajax) Diniz
Martin v. Löwis wrote:
> In addition, I would like to see a specification of the exact labels to
> be used, plus a one-line description that should be attached to the
> labels.

Tennessee,
If you'd like to test those additional status options, I'm setting a
test instance of the Python tracker up at
http://bot.bio.br/python-dev/ . It might be frequently offline for a
while, but once things are stable it'll be reliable enough to perform
such experiments.

If it's easy on resource usage, I might have one instance following
the Python tracker code closely and a more bleeding-edge one :)

Regards,
Daniel
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Core projects for Summer of Code

2009-03-19 Thread Steve Holden
Raymond Hettinger wrote:
> Another thought:  it would be nice is pydoc were built-out with an
> alternate html generator that emitted clean, simple html
> with the appropriate div/span tags so that CSS can be used
> to control formatting.  Right now, all of the formatting and
> color coding is in-line.  If you don't like the appearance of
> the output, the module is unusable.  This is likely a two to
> three day project, easy and fun.
> 
That makes it a much better candidate for GHOP that SoC, which requires
projects with a little more meat on them.

regards
 Steve
-- 
Steve Holden   +1 571 484 6266   +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Want to know? Come to PyCon - soon! http://us.pycon.org/

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


Re: [Python-Dev] Core projects for Summer of Code

2009-03-19 Thread Arc Riley
> That makes it a much better candidate for GHOP that SoC, which requires
> projects with a little more meat on them.


Yes it does.

Though many organizations have taken to funding their own GHOPs.  Perhaps
this year PSF can use the SoC funds ($500/student) to host a bounty-sprint
program much like GHOP?

IIRC, GHOP paid $100 per 3 tasks.  With the economy in the tank this could
attract a lot more than highschool students.  Honestly I wish SoC was
structured more like GHOP, it seemed much more effective and for the same
funding could run year-round.

Or the same funds could be used to host various optimization competitions,
replacement Py3 extension/type/function must match API and pass unit
testing.  Fastest solution wins (ie) $1000 and fame for the person or team
that submitted it.

Something to keep in mind and for the PSF board to ponder for this Fall.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Core projects for Summer of Code

2009-03-19 Thread Steve Holden
Arc Riley wrote:
> 
> That makes it a much better candidate for GHOP that SoC, which requires
> projects with a little more meat on them.
> 
> 
> Yes it does.
> 
> Though many organizations have taken to funding their own GHOPs. 
> Perhaps this year PSF can use the SoC funds ($500/student) to host a
> bounty-sprint program much like GHOP?
> 
> IIRC, GHOP paid $100 per 3 tasks.  With the economy in the tank this
> could attract a lot more than highschool students.  Honestly I wish SoC
> was structured more like GHOP, it seemed much more effective and for the
> same funding could run year-round.
> 
> Or the same funds could be used to host various optimization
> competitions, replacement Py3 extension/type/function must match API and
> pass unit testing.  Fastest solution wins (ie) $1000 and fame for the
> person or team that submitted it.
> 
> Something to keep in mind and for the PSF board to ponder for this Fall.
> 
Why wait until Fall if it's a good idea? The summer vacation would
surely be the ideal time for this, and that would mean we should start
planning soon.

Anyway, the first requirement would be some enthusiasm from the
developer team for mobilizing such a potential source of assistance.

regards
 Steve
-- 
Steve Holden   +1 571 484 6266   +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Want to know? Come to PyCon - soon! http://us.pycon.org/

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


Re: [Python-Dev] Core projects for Summer of Code

2009-03-19 Thread Arc Riley
If it's organized in time we could scoop up some of the SoC applicants who
we'll like to have but we won't have slots for

Honestly I like the idea of competitions.  Better publicity, the greater
prizes will draw out some better minds from the community, and competitions
based on quality will help ensure usable code.  They could vary in reward
based on how difficult the problem is and perhaps have some Python swag as
runner-up prizes.

It'd also be a great way to promote Python 3.


On Thu, Mar 19, 2009 at 10:00 PM, Steve Holden  wrote:

> Arc Riley wrote:
> >
> > That makes it a much better candidate for GHOP that SoC, which
> requires
> > projects with a little more meat on them.
> >
> >
> > Yes it does.
> >
> > Though many organizations have taken to funding their own GHOPs.
> > Perhaps this year PSF can use the SoC funds ($500/student) to host a
> > bounty-sprint program much like GHOP?
> >
> > IIRC, GHOP paid $100 per 3 tasks.  With the economy in the tank this
> > could attract a lot more than highschool students.  Honestly I wish SoC
> > was structured more like GHOP, it seemed much more effective and for the
> > same funding could run year-round.
> >
> > Or the same funds could be used to host various optimization
> > competitions, replacement Py3 extension/type/function must match API and
> > pass unit testing.  Fastest solution wins (ie) $1000 and fame for the
> > person or team that submitted it.
> >
> > Something to keep in mind and for the PSF board to ponder for this Fall.
> >
> Why wait until Fall if it's a good idea? The summer vacation would
> surely be the ideal time for this, and that would mean we should start
> planning soon.
>
> Anyway, the first requirement would be some enthusiasm from the
> developer team for mobilizing such a potential source of assistance.
>
> regards
>  Steve
> --
> Steve Holden   +1 571 484 6266   +1 800 494 3119
> Holden Web LLC http://www.holdenweb.com/
> Want to know? Come to PyCon - soon! http://us.pycon.org/
>
>
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com