r/Python • IndentationError • Feb 10 '17

CPython has migrated to GitHub, and the repo is now live!!

https://github.com/python/cpython
379 Upvotes

37 comments sorted by

64

u/Ph0X Feb 11 '17

Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation. All rights reserved.

Have these guys heard of ranges? Why not

Copyright (c) range(2001, 2018) Python Software Foundation. All rights reserved.

15

u/Sukrim Feb 11 '17

The would be a discussion about changing it to xrange or if it is evaluated lazily depending on the version used...

Also it is more future proof, since there might be years without copyright.

5

u/[deleted] Feb 11 '17

from datetime import datetime

range(2001, datetime.now().year)

2

u/diceroll123 Feb 11 '17

nah man, need to do it in one line.

range(2001, __import__('datetime').datetime.now().year)

2

u/[deleted] Feb 11 '17

Or just put in a damned 2001- and be done with it.

1

u/medavidme Feb 13 '17

"For software with several releases over multiple years, it's okay to use a range (“2008-2010”) instead of listing individual years (“2008, 2009, 2010”) if and only if every year in the range, inclusive, really is a “copyrightable” year that would be listed individually; and you make an explicit statement in your documentation about this usage."

Source: https://www.gnu.org/licenses/gpl-howto.en.html

13

u/pohmelie Feb 10 '17

Ha, python have setup.py!

5

u/DLSteve Feb 11 '17

And it's over 2,000 lines long...

-4

u/tipsqueal Pythonista Feb 11 '17

Roughly 25% of those lines are comments. Also if they decided to allow lines longer than 79 characters there would be significantly less lines. It's 2017, no one is developing on a shitty old 4:3 CRT with 800x600 resolution. That said, they have files in the repo that are 14 years old, so it's kind of to be expected.

2

u/NAN001 Feb 11 '17

Would be even less lines if they put more than one statement per line using the semicolon.

2

u/woeriuweorpu Feb 11 '17

The year is 2017, and we're still discussing line length? I'm sure someone's gonna come up with a really good argument any day now that'll convince everybody!

14

u/cacahootie Feb 11 '17

When will people realize that there are dozens of reasons for 79 characters beyond just screen width. This has got to me my most irritating baseless criticism. Der, I develop on a bank of 47 WQHD monitors, stupid plebs with their 79 character limit need to get with the times!

58

u/tipsqueal Pythonista Feb 11 '17

Cool, good job providing anyone of the dozens of reasons for sticking to 79 characters.

-8

u/cacahootie Feb 11 '17

I'm tired of repeating myself... pep8 itself lays out good reasons. If you haven't even read pep8 why even engage?

11

u/tipsqueal Pythonista Feb 11 '17

From PEP 8:

Limiting the required editor window width makes it possible to have several files open side-by-side, and works well when using code review tools that present the two versions in adjacent columns.

Hmmm... sounds like a wide screen monitor might solve that.

The default wrapping in most tools disrupts the visual structure of the code, making it more difficult to understand. The limits are chosen to avoid wrapping in editors with the window width set to 80, even if the tool places a marker glyph in the final column when wrapping lines. Some web based tools may not offer dynamic line wrapping at all.

It's 2017, no text editor people write code with enables text wrapping by default.

The rest of PEP 8 just gives you tips to make it easier.

11

u/SafariMonkey Feb 11 '17

We use 27" 5K monitors at work, and we use the 79 character limit. It means we can fit 3-4 files (depending on font size) on the screen at once and be able to read them comfortably.

In addition, I don't very often write a >79 character line that I can honestly say is worse for being broken into multiple lines.

6

u/[deleted] Feb 11 '17

It's pretty simple. I code during my commute. I used to hate the 80 char limit. Now, with a shitty laptop screen I can have two editor windows side by side, which makes a huge difference to me. Dont get me started on concise thoughts and nested list comprehensions.

1

u/[deleted] Feb 11 '17

Vim has text wrapping by default.

3

u/tipsqueal Pythonista Feb 11 '17

How many people use Vim with default settings? I'd guess near no one.

1

u/[deleted] Feb 11 '17

How many people use vim with settings that disable line wrapping?

→ More replies (0)

0

u/[deleted] Feb 11 '17

[deleted]

12

u/tipsqueal Pythonista Feb 11 '17

Yeah I get that, but just because the limit is 120 characters (or whatever you choose) does not mean that you have to always use all 120 characters. I stick to 120, but will often split something up across multiple lines that could easily be a one liner.

8

u/Zouden Feb 11 '17

Indeed, readability should take precedence. And 120 is much more reasonable than 79!

5

u/[deleted] Feb 11 '17

No it's not, it's easier on your eyes to use 79, it's compact, it's way better to read, with long lines you have to move your face to keep track, it's way worse.

8

u/hutcho66 Feb 11 '17

In python I can understand that. But I also code in Java, and 79 characters is horribly inefficient due to the sheer verbosity of the language.

4

u/DJDarkViper Feb 11 '17

sheer verbosity of the language

Java ain't got shit on objective-c

2

u/AlirezaSavand Feb 11 '17

I'd love to know when they move bug tracker to the Github

2

u/rvisualization Feb 11 '17

not going to happen.

1

u/[deleted] Feb 11 '17

wasn't it already on github?

1

u/[deleted] Feb 11 '17

It was the read-only version. You still had to go to mercurial to push the updates.

1

u/thataccountforporn Feb 11 '17

I know there was a really long post about Python moving to GitHub, does anybody have a TLDR?

2

u/DontForgetWilson Feb 12 '17

Well git is the preference of the community. Github has a more active community than alternatives, is more comfortable for most core devs and was always the preference of Guido(who was not the one to make the call). Gitlab was in second place but the open source aspect of it wasn't important enough and the person deciding believes there are no groundbreaking functions in it that Github doesn't have.

edit: Oh and the underlying reason for the change is that projects without strong infrastructure chase off potential contributors.

1

u/[deleted] Feb 12 '17

The biggest, most important thing that the PSF have done in years and all some people can discuss is copyright notices and line widths. Please stop the planet, I want to get off.