Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Code review?

50 views
Skip to first unread message

Adam

unread,
Jan 13, 2014, 11:29:47 AM1/13/14
to pytho...@python.org
Hey all. New to the list. I’m working on a web app with 2.6 and Flask. I’m still relatively new to python. Is there a chance to get a code review from anyone? I really want someone to just tear up my code and tell me how to increase my efficiency and what I’m doing wrong (and how to upload images via a form in Flask, but that’s another story).

Happy coding
Adam

Chris Angelico

unread,
Jan 13, 2014, 11:40:25 AM1/13/14
to pytho...@python.org
On Tue, Jan 14, 2014 at 3:29 AM, Adam <sk8...@gmail.com> wrote:
> Hey all. New to the list. I’m working on a web app with 2.6 and Flask. I’m still relatively new to python. Is there a chance to get a code review from anyone? I really want someone to just tear up my code and tell me how to increase my efficiency and what I’m doing wrong (and how to upload images via a form in Flask, but that’s another story).
>

Definitely! Preferably, post your code in-line; if it's too long for
that, post it someplace else and link to it. Be sure not to damage
indentation, of course, but no matter how new you are to Python you'll
know that!

Incidentally, is there a reason you're using Python 2.6? You should be
able to upgrade at least to 2.7, and Flask ought to work fine on 3.3
(the current stable Python). If it's the beginning of your project,
and you have nothing binding you to Python 2, go with Python 3.
Converting a small project now will save you the job of converting a
big project in ten years' time :)

ChrisA

Steven D'Aprano

unread,
Jan 13, 2014, 3:43:53 PM1/13/14
to
On Tue, 14 Jan 2014 03:40:25 +1100, Chris Angelico wrote:

> Incidentally, is there a reason you're using Python 2.6? You should be
> able to upgrade at least to 2.7, and Flask ought to work fine on 3.3
> (the current stable Python). If it's the beginning of your project, and
> you have nothing binding you to Python 2, go with Python 3. Converting a
> small project now will save you the job of converting a big project in
> ten years' time

Everything you say is correct, but remember that there is a rather large
ecosystem of people writing code to run on servers where the supported
version of Python is 2.6, 2.5, 2.4 and even 2.3. RedHat, for example,
still has at least one version of RHEL still under commercial support
where the system Python is 2.3, at least that was the case a few months
back, it may have reached end-of-life by now. But 2.4 will definitely
still be under support.

(I don't believe there is any mainstream Linux distro still supporting
versions older than 2.3.)

Not everyone is willing, permitted or able to install Python other than
that which their OS provides, and we ought to respect that.

Hell, if somebody wants to ask questions about Python 1.5, we can answer
them! The core language is still recognisably Python, a surprisingly
large number of libraries were around back then (it was Python 1.4 or 1.5
which first got the reputation of "batteries included"), and I for one
still have it installed so I can even test code for it.


--
Steven

Chris Angelico

unread,
Jan 13, 2014, 6:34:15 PM1/13/14
to pytho...@python.org
On Tue, Jan 14, 2014 at 7:43 AM, Steven D'Aprano <st...@pearwood.info> wrote:
> On Tue, 14 Jan 2014 03:40:25 +1100, Chris Angelico wrote:
>
>> Incidentally, is there a reason you're using Python 2.6? You should be
>> able to upgrade at least to 2.7, and Flask ought to work fine on 3.3
>> (the current stable Python). If it's the beginning of your project, and
>> you have nothing binding you to Python 2, go with Python 3. Converting a
>> small project now will save you the job of converting a big project in
>> ten years' time
>
> Everything you say is correct, but remember that there is a rather large
> ecosystem of people writing code to run on servers where the supported
> version of Python is 2.6, 2.5, 2.4 and even 2.3. RedHat, for example,
> still has at least one version of RHEL still under commercial support
> where the system Python is 2.3, at least that was the case a few months
> back, it may have reached end-of-life by now. But 2.4 will definitely
> still be under support.

Pledging that your app will run on the system Python of RHEL is
something that binds you to a particular set of versions of Python.
It's not just library support that does that.

ChrisA

Bob Martin

unread,
Jan 14, 2014, 2:22:01 AM1/14/14
to
Does any Linux distro ship with Python 3? I haven't seen one.

Bayram Güçlü

unread,
Jan 14, 2014, 2:29:56 AM1/14/14
to

Chris Angelico

unread,
Jan 14, 2014, 2:36:49 AM1/14/14
to pytho...@python.org
On Tue, Jan 14, 2014 at 6:22 PM, Bob Martin <bob.m...@excite.com> wrote:
> Does any Linux distro ship with Python 3? I haven't seen one.

On most Debian-based distros, you can simply 'apt-get install
python3', and you'll get some 3.x version (in Debian Squeeze, that's
3.1, Debian Wheezy packages 3.2; Ubuntu since Raring gives you 3.3).
Whether or not you actually have it - or python2 for that matter -
installed depends on your choices, anything that depends on it will
pull it in or you can grab it manually.

Arch Linux ships 3.3.3 under the name "python", and 2.7.6 under the
name "python2" - an inversion of the Debian practice. Other distros
are looking toward shifting, too.

I'd guess that all mainstream distributions carry both branches. It's
just a question of what people get when they ask for "Python" in the
most normal way to do that.

ChrisA
0 new messages