Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Interviews: Q&A With Guido van Rossum

samzenpus posted 1 year,28 days | from the ask-away dept.

Python 242

Guido van Rossum is best known as the creator of Python, and he remains the BDFL (Benevolent Dictator For Life) in the community. The recipient of many awards for his work, and author of numerous books, he left Google in December and started working for Dropbox early this year. A lot has happened in the 12 years since we talked to Guido and he's agreed to answer your questions. As usual, ask as many as you'd like, but please, one question per post.

cancel ×


Sorry! There are no comments related to the filter you selected.

Dear Guido (1, Interesting)

For a Free Internet (1594621) | 1 year,28 days | (#44608013)

Will you take the most important step of your career, and become a true giant among men, by endorsing the CAMPAIGN FOR A FREE INTERNET, guided by the all-knowing principles of our PRESIDENT FOR LIFE, LAURA? And if not, why are you such a dumbass and a scoundrel?

Yours Truly,

From Google to Dropbox (4, Interesting)

nurhussein (864532) | 1 year,28 days | (#44608017)


What prompted the move from Google to Dropbox? What did you do at Google, and what are you going to do at Dropbox?

Re:From Google to Dropbox (-1, Offtopic)

Anonymous Coward | 1 year,28 days | (#44608107)

failure to follow simple directions

Re:From Google to Dropbox (-1, Troll)

davester666 (731373) | 1 year,28 days | (#44608673)

you don't get frosty piss by following directions

And you certainly don't by taking the time to read the summary.

GIL (5, Interesting)

Anonymous Coward | 1 year,28 days | (#44608065)

When will you remove the GIL?

Re:GIL (4, Informative)

HaZardman27 (1521119) | 1 year,28 days | (#44608231)

I think they've always been open about the fact that the GIL will be removed once someone offers a good solution for removing it.

Re:GIL (-1)

Anonymous Coward | 1 year,28 days | (#44609689)

The Knuth-Chalmers lock reduction algorithm would eliminate the GIL. However, they reject all patches for it since it is "incompatible" with mandatory white space indentation.

Re:GIL (1)

NeverWorker1 (1686452) | 1 year,28 days | (#44608341)

IronPython and Jython have no GIL. Unfortunately, IronPython is no longer being maintained and the last release was over a year ago.

Re:GIL (1)

TeknoHog (164938) | 1 year,28 days | (#44608911)

It will be removed only if the defendant is found not GIL-cup.

Re:GIL (1)

strombrg (62192) | 1 year,28 days | (#44609061)

Rumor has it that patches were submitted for removing the GIL from CPython once, but they made uniprocessor workloads so much slower that the patches were rejected.

Re:GIL (1)

strombrg (62192) | 1 year,28 days | (#44609575)

Also, CPython having a GIL supposedly makes it easier to write C extension modules, which may be partially responsible for the large number of such modules for CPython.

Privacy (0)

Anonymous Coward | 1 year,28 days | (#44608071)

What is your stance in the debate about privacy for internet users. Not necessarily regarding the NSA but also commercial companies. Especially because both Google and Dropbox handle huge amount of private data of their customers. Does this stroke with the philosophy in which Python was developed?

Who's watching (5, Interesting)

Anonymous Coward | 1 year,28 days | (#44608087)

Does the NSA have access to our Dropbox contents, as is apparently the case with Microsoft Skydrive?

Re:Who's watching (1)

lister king of smeg (2481612) | 1 year,28 days | (#44608827)

did you look at the prism slides? guess whos logo is up there with ms, google, skype, and yahoo? dropbox. they have to listen to nation security letters and blanket fisa court orders just like everyone else.

Obummer is bad! (-1, Troll)

Anonymous Coward | 1 year,28 days | (#44608103)

Do you support Obummer and his war on civil liberties and white people?

BC Breaking changes in 3 (5, Interesting)

PktLoss (647983) | 1 year,28 days | (#44608133)

Do you regret the swath of backwards incompatible changes in version 3 that have lead to such slow uptake, or do you feel it was the best move for the language moving forward?

Re:BC Breaking changes in 3 (4, Interesting)

HaZardman27 (1521119) | 1 year,28 days | (#44608311)

I would be very interested in seeing the answer to this. As a Python programmer I've nearly entirely avoided using Python 3.x in favor of 2.7. I just see fewer advantages to it than disadvantages (having to update old code, learning which libraries I use support 3.x, etc.). The Python community seems divided between 2.7 and 3, and this is problematic for a language designed to be clean with a "correct" and "pythonic" way of doing things.

Re:BC Breaking changes in 3 (0)

phantomfive (622387) | 1 year,28 days | (#44608801)

This is my #1 reason for not using Python. Why use a language that has no commitment to backwards compatibility when there are plenty that do?

Re:BC Breaking changes in 3 (2)

TeknoHog (164938) | 1 year,28 days | (#44609159)

One could argue that Python is learning from some of the early mistakes. For example print function vs. statement. On the other hand, one of the key strengths of Python is having lots of nice libraries by default, and these have undergone changes independent of the 2 -> 3 core language changes. It's a little inconvenient, but libraries evolve, no matter what language you use.

Re:BC Breaking changes in 3 (3, Insightful)

gr8_phk (621180) | 1 year,28 days | (#44609265)

This is my #1 reason for not using Python. Why use a language that has no commitment to backwards compatibility when there are plenty that do?

Why use a language that is interested in "backwards compatibility" when Python is into "forward compatibility". You can "import from future *" to make your code use features that are not yet in the latest release. Why embrace legacy ways of doing things when you can be focused on the future instead? I find the push to make it more perfect for the future a plus even if it means short term pain.

Re:BC Breaking changes in 3 (2)

sydneyfong (410107) | 1 year,28 days | (#44609289)

Name me a mainstream programming language which has only been intentionally backwards incompatible *once* in its 20 year history.

I can only think of C.

Re:BC Breaking changes in 3 (1)

Anonymous Coward | 1 year,28 days | (#44609003)

stop crying, just upgrade. it is not so difficult.

Java people whined like you and they ended up with broken language.

Re:BC Breaking changes in 3 (2)

wiredlogic (135348) | 1 year,28 days | (#44609669)

You know it is entirely possible to write 2.7 code that works with nothing more than a pass through 2to3. That does mean that any libraries you depend on are available for 3.x but the problem of lacking support from 3rd party libraries is beginning to diminish as more are ported over at an increasing rate.

You can also start training yourself for the switch to Python 3 now by using all of the from __future__ imports which will also increase the ease of getting 2to3 output working when any missing support is implemented in the future. I used this approach on a 10K SLOC library that required a manual fix to a single line of code to get running on 3.x.

Re:BC Breaking changes in 3 (0)

Anonymous Coward | 1 year,28 days | (#44608471)

follow-up: having decided to break backward compatibility, do you regret not making more sweeping changes to python 3 to make it more compelling? Things like adding better destructuring assignment, pattern matching, etc?

socks and sandals (0)

Anonymous Coward | 1 year,28 days | (#44609385)

Why socks with sandals?

Interviews (4, Interesting)

semanticgap (468158) | 1 year,28 days | (#44608137)


When you interviewed at Google - did they ask you brainteaser or hard algorithmic questions, and if so, what did you think of it?


Why (-1)

Anonymous Coward | 1 year,28 days | (#44608153)

Why give the world another and undoubltly ugly (just looking at code) programming language?
Perl was already there ;)

Hee hee hee... (-1)

Anonymous Coward | 1 year,28 days | (#44608189)

Are you a shower or a grower?

Loving python (-1)

sl4shd0rk (755837) | 1 year,28 days | (#44608215)

Hello Guido,
          Has the forced
          indenting model of Python
          affected your life in any way?

I found it very easy
          to adapt to after doing it
          for awhile, and nowdays
          it's just become so automatic
          I don't even notice it.

Re:Loving python (-1, Troll)

Anonymous Coward | 1 year,28 days | (#44608237)

Python is a shameless, object oriented, rip-off of COBOL. There, I said it.

If a COBOL developer had PHP described to them in a sentence, they'd have created something identical to Python. You know it. I know it. Everyone knows it.

Re:Loving python (2)

dmbasso (1052166) | 1 year,28 days | (#44608327)

if you want to joke about indentation:
    at least make it syntactically sound

while you're at it:
    follow pep8

Re:Loving python (2)

strombrg (62192) | 1 year,28 days | (#44609197)

I've commented on python and whitespace enough times, that it became more practical to create a small web page about it: Read it here [] .

Re:Loving python (1)

Anonymous Coward | 1 year,28 days | (#44609521)

Can you put it on a website that doesn't look like shit?

When is python going to support parallel procesing (0, Interesting)

Anonymous Coward | 1 year,28 days | (#44608225)

When is python going to support parallel processing and multiple threads?
Every other modern programming language does.

Re:When is python going to support parallel proces (2)

NeverWorker1 (1686452) | 1 year,28 days | (#44608245)

Python does support threading. The issue is that CPython implementation has the GIL to contend with. IronPython did away with the GIL, but it's no longer being maintained. Also, [] beat you too it.

Re:When is python going to support parallel proces (1)

strombrg (62192) | 1 year,28 days | (#44609235)

Python the language definition, supports threads fine. CPython the reference implementation, supports threads, but while they work fine for I/O bound workloads, they are poor for CPU bound workloads. However, CPython supports multiprocessing, which uses multiple processes and shared memory; multiprocessing tends to give looser coupling between parallel code units than threading. Jython and IronPython support threads for both I/O bound and CPU bound workloads.

Why did Python avoid some common "OO" idioms? (3, Interesting)

i_ate_god (899684) | 1 year,28 days | (#44608247)

Interfaces, abstract classes, private members, etc... Why did python avoid all this?

Re:Why did Python avoid some common "OO" idioms? (2)

knapper_tech (813569) | 1 year,28 days | (#44608737)

Ultimately, since Python is dynamic down to being able to override the data model of an object on the fly, there would be no point. There is no point in any program really. Underscores do just as good of job as public/private declarations at telling me which parts of the API are for users and which are for the class. I might use private attributes and methods, but I ought to know what I'm doing if I do. Any program's data can be made public, and the more frequently the need arises, the better programmers get at using introspection to uncover the private members, and suddenly there's no point.

One of the older justifications given for encapsulation and header files was to be able to sell binary objects. If you can't read the source for the library, you can't figure out how all the parts work, so you better use the public API or you might really screw something up. This is totally irrelevant in the world of open source software. Underscores are a totally valid solution to telling other programmers who might modify the encapsulation what the intent was at one point, giving them a strong hint that they need to dig deeper before messing around. If encapsulation is a gentleman's agreement, why does it need a language feature?

Re:Why did Python avoid some common "OO" idioms? (1)

Rob Riggs (6418) | 1 year,28 days | (#44608777)

Interfaces, abstract classes, private members, etc... Why did python avoid all this?

I'm curious -- how many dynamically-typed languages have these features?

Re:Why did Python avoid some common "OO" idioms? (1)

strombrg (62192) | 1 year,28 days | (#44609087)

Python is duck typed - no need for interfaces, though it'd be nice to have them in pylint. Python has abstract classes. Python has a weak form of private members.

Re:Why did Python avoid some common "OO" idioms? (1)

jon3k (691256) | 1 year,28 days | (#44609371)

I'm not a python programmer by any stretch of the imagination, but aren't private methods more by convention and less through actual strict enforcement? As in, you can declare a member private but it can still be accessed, it just "shouldn't be" by convention?

Re:Why did Python avoid some common "OO" idioms? (1)

oldhack (1037484) | 1 year,28 days | (#44609137)

Interfaces, abstract classes, private members, etc... Why did python avoid all this?

Those things are irrelevant in Python because Python's "types" are defined by what they actually do, not what they declare to do.

Hoo haa! (-1)

Anonymous Coward | 1 year,28 days | (#44608255)

What are your views on fanny bandits who are trying to defile the sanctity of holy matrimony?

Multi-line lambdas (3, Interesting)

NeverWorker1 (1686452) | 1 year,28 days | (#44608309)

One of the most common complaints about Python is the limitations of its lambdas, namely being one line only without the ability to do assignments. Obviously, Python's whitespace treatment is a major part of that (and, IIRC, I've read comments from you to that effect). I've spent quite a bit of time thinking about possible syntax for a multi-line lambda, and the best I've come up with is trying to shoehorn some unused (or little used) symbol into a C-style curly brace, but that's messy at best. Is there a better way, and do you see this functionality ever being added?

Re:Multi-line lambdas (3, Funny)

blamelager (1152861) | 1 year,28 days | (#44608401)

>>> from __future__ import braces

Re:Multi-line lambdas (2)

NeverWorker1 (1686452) | 1 year,28 days | (#44608453)

Exactly. It's terribly unpythonic. Sadly though, I don't have a better way to do multi-line lambdas.

Re:Multi-line lambdas (0)

Anonymous Coward | 1 year,28 days | (#44608753)

Sure, but when is adding a name to a longer function really so inconvenient?

It's a minor part of the bigger mistake in emphasising OOP at the expense of clean functional programming.

Never understood why some people seem to love spaghetti object hierarchies.

Re:Multi-line lambdas (1)

rmstar (114746) | 1 year,28 days | (#44609635)

Sure, but when is adding a name to a longer function really so inconvenient?

Well, it's yet another name. And one that would not have been needed if python lambdas were proper lambdas.

It's all a matter of convenience, and tripping over a disappointing and gratuitious limitation isn't nice either.

Re:Multi-line lambdas (0)

Anonymous Coward | 1 year,28 days | (#44608745)

or why even make a distinction between lambdas and named functions? or why not just make everything an expression, if assignment returned the assigned value you could use it in a lambda.

Re:Multi-line lambdas (1)

knapper_tech (813569) | 1 year,28 days | (#44608757)

Keep in mind that Python uses a stack machine VM and that this makes function call overhead large, as each call requires a new stack frame to be set up. A strong lambda will lead to creep. Then again, why don't we have a register based VM?

Re:Multi-line lambdas (1)

strombrg (62192) | 1 year,28 days | (#44609111)

You're almost always better off using a generator expression or list comprehension instead of a lambda. Also, multiline lambdas detract from readability.

Re:Multi-line lambdas (4, Insightful)

DriedClexler (814907) | 1 year,28 days | (#44609241)


1) Make it a named function.
2) Place the name where you'd otherwise put the lambda.

It works, although you have to deal with the horror of a reusable function defined a few lines up.

Why is Python so awesome? (1)

Laxori666 (748529) | 1 year,28 days | (#44608337)

Hate to throw a curveball here, but answer honestly: why is Python such an awesome language?

Re:Why is Python so awesome? (0)

Anonymous Coward | 1 year,28 days | (#44609089)

It isn't.

Re: Why is Python so awesome? (0)

Anonymous Coward | 1 year,28 days | (#44609797)

Because it writes and reads like pseudocode, but works.

Best & worst of Python? (2)

Laxori666 (748529) | 1 year,28 days | (#44608353)

Compound question here: what part of Python is or became your favorite, and what's the worst thing, something that you would change if you knew now what you did then?

One thing different (5, Interesting)

NeverWorker1 (1686452) | 1 year,28 days | (#44608367)

If you could go back to the very start and change one thing about Python, what would it be and why?

Re:One thing different (1, Funny)

Anonymous Coward | 1 year,28 days | (#44608519)

Add curly braces. Duh.

PyPy (5, Interesting)

Btrot69 (1479283) | 1 year,28 days | (#44608389)

Do you see PyPy as the future ? []
Or do you remain unconvinced, and -- if so -- why ?

Re:PyPy (0)

Anonymous Coward | 1 year,28 days | (#44608883)

Do you see PyPy as the future ? []
Or do you remain unconvinced, and -- if so -- why ?

+1 I'd love to know

How to learn from you, with you... (1)

djupedal (584558) | 1 year,28 days | (#44608403)

Do you take on interns or devs that want to learn by doing while sitting in the same room w/you?

Tail recursion (1)

NeverWorker1 (1686452) | 1 year,28 days | (#44608425)

You've stated ( that you consider tail recursion to be "unpythonic." Could you elaborate on that a little more. What about algorithms that are by their very nature recusive? I've found that a combination of memoization and tail recursion can, under the right circumstance, provide wonderfully clear code without taking too much of a performance hit, and Python's decorator facility always seemed more or less ideal to me for that sort of application.

Re:Tail recursion (1)

strombrg (62192) | 1 year,28 days | (#44609273)

Tail recursion can be hard to debug - no stack frames to look back at.

Re:Tail recursion (1)

NeverWorker1 (1686452) | 1 year,28 days | (#44609597)

That's one of Guido's concerns in the blog post I linked.

Python in the browser ? (3, Informative)

Btrot69 (1479283) | 1 year,28 days | (#44608477)

Over the years, there have been several attempts to create a sandboxed version of python that will safely run in a web browser.
Mostly this was because of problems with Javascript.
Now that Javascript works -- and we have nice things like CoffeeScript -- is it time to give up on python in the browser ?

Re:Python in the browser ? (1)

strombrg (62192) | 1 year,28 days | (#44609365)

Python, as a plugin, would require adoption by Chrome, Firefox, Internet Explorer, Opera - I doubt all four of these would all agree to support Python as a plugin. However, it's possible to compile Python to javascript [] . Most of these transpile individual Python programs to JavaScript, but one, empythoned, actually compiles CPython 2.x to JavaScript using LLVM's JavaScript backend.

Scalar context (0)

Anonymous Coward | 1 year,28 days | (#44608495)

Why doesn't range(['a', 'b', 'c']) equal [0, 1, 2]?

-- Just another Perl hacker

Re:Scalar context (1)

sunami (751539) | 1 year,28 days | (#44608889)

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    range(['a', 'b', 'c'])
TypeError: range() integer end argument expected, got list.

Another BDFL (4, Interesting)

Anonymous Coward | 1 year,28 days | (#44608497)

What is your view on the tone that Linus uses on the LKML? Do you think it actually provides any benefits or just drives away would-be contributors?

spit or swallow? (-1)

Anonymous Coward | 1 year,28 days | (#44608511)

also, do you prefer length or girth in a python?

CPython C API (0)

Anonymous Coward | 1 year,28 days | (#44608515)

Are there any plans for providing/incorporating an interface for python and C interaction that isn't CPython specific?

Re:CPython C API (1)

strombrg (62192) | 1 year,28 days | (#44609401)

Here's a list [] . See especially CFFI.

GIL and true parallelism (4, Interesting)

neonleonb (723406) | 1 year,28 days | (#44608537)

The main thing that keeps Python from being really useful for my projects is the Global Interpreter Lock (GIL). I would love to write Python for my data-intensive code, but it is impossible to get really good parallelism with Python; the multiprocessing library isn't a magic fix because then I have to move all my data back and forth between processes.

When, if ever, should I expect to be able to use Python to do parallel data processing? What is the priority for this, and what would need to be done to make thread-level parallelism possible?

Re:GIL and true parallelism (1)

NeverWorker1 (1686452) | 1 year,28 days | (#44608567)

FWIW, IronPython and Jython are GIL-free, but IronP is no longer maintained.

Re:GIL and true parallelism (2)

neonleonb (723406) | 1 year,28 days | (#44608741)

And Jython doesn't work with numpy, which is one of Python's best features. The JVM is great for parallelism, but numerical computing on it isn't very fast.

Re:GIL and true parallelism (1)

oldhack (1037484) | 1 year,28 days | (#44609171)

I would mod this up if I had points.

Go! usage at Google (0)

Anonymous Coward | 1 year,28 days | (#44608583)

Did the usage of Go! at Google influence your decision to leave Google?

Python 3 Regrets (3, Insightful)

n1ywb (555767) | 1 year,28 days | (#44608589)

If you could go back in time, what, if anything, would you do differently WRT to developing and releasing Python 3?

name of the language (1)

ebno-10db (1459097) | 1 year,28 days | (#44608597)

Do you wish you'd named your language after a different type of snake?

P.S. Yes I know it's from "Monty Python". If it'd been my language I would have called it Groucho.

Key question for any language designer (4, Interesting)

dkleinsc (563838) | 1 year,28 days | (#44608663)

Have the prospects of Python in any way improved since you grew a beard [] ? To what degree does language success correlate to beard length?

Any NSA backdoors in Python ? (2, Interesting)

Btrot69 (1479283) | 1 year,28 days | (#44608685)

Are you aware of any attempts by the NSA to add a backdoor in Python ?
Of course, if you did get an NSA letter, you wouldn''t be allowed to say.
You are welcome to NOT ANSWER this question.
We will take note of that ;)

Re:Any NSA backdoors in Python ? (1)

NeverWorker1 (1686452) | 1 year,28 days | (#44608877)

What does that even mean? It's a programming language, not an application or operating system. Do you mean crippling certain functions in the standard library? It's all open source.

Do enums herald a trend? (1)

Anonymous Coward | 1 year,28 days | (#44608695)

Python 3.4 will feature enum types built-in into the language. Up to now, Python mostly avoided features that promoted explicit type checking (through isinstance). Is the inclusion of enums a sign that we can expect more of such features in the future (say, contracts on function parameters)?

What language instead, if Python was not created? (1)

tadeck (1222118) | 1 year,28 days | (#44608769)

Lets imagine you have not created Python, but some other programming language. Relying on your judgment, what existing (but not necessarily popular) programming language would be the closest to your mindset / principles / preferences? Or maybe there is none - in such case, how would it differ from Python?

That question baffles me, as you are guru of significant part of developers and surely there is some language that either follows good parts of Python, or avoids Python mistakes. Could you share your thoughts on what would be your choice for Python replacement, if creation of Python would not be possible?

Ps. Many people seem to treat Ruby as being very close to Python. If you will pick Ruby, could you pick also another language, that you would pick after Python and Ruby?

functional programming (4, Insightful)

ebno-10db (1459097) | 1 year,28 days | (#44608785)

Some people claim that Python is, at least partly, a functional language. You disagree, as do I. Simply having a few map and filter type functions does not make for a functional language. As I understand it those functions were added to the libraries by a homesick Lisper, and that several times you've been tempted to eliminate them. In general it seems you're not a fan of functional programming, at least for Python.

Question: do you feel that the functional programming approach is not very useful in general, or simply that it's not appropriate for Python? It would be nice to hear your reasons either way.

Re:functional programming (1)

strombrg (62192) | 1 year,28 days | (#44609431)

map, filter and reduce are almost always better done as a generator expression or list comprehension, FWIW. I'm interested in hearing about Python and Functional Programming though.

NSL (1, Offtopic)

ThatsNotPudding (1045640) | 1 year,28 days | (#44608803)

What *does* a National Security Letter look like?

Asynchronous python (0)

Anonymous Coward | 1 year,28 days | (#44608953)

Asynchronous programming allows for high performance networking (servers, services...).

gevent vs twisted vs eventlet: do you have an opinion? Where do you think it's headed? What is using dropbox?

What do you think about web2py? (0)

Anonymous Coward | 1 year,28 days | (#44608977)

web2py is one of the famous python frameworks and also one of the most criticized for its "different" architecture. What do you think about it?

why should I adopt Python 3? (3, Interesting)

js_sebastian (946118) | 1 year,28 days | (#44608999)

What are the big features/improvements of python 3 that could/should convince me to make the effort to switch over from python 2.x to python 3.x?

I am not able to do the switch now as I rely on some libraries that have not finished converting to python 3 yet, but having something to look forward to other than the pain of backwards-incompatibility could go a long way in getting me to prepare for the change instead of ignoring the issue.

Re:why should I adopt Python 3? (0)

Anonymous Coward | 1 year,28 days | (#44609125)

"print" is now a function, with parentheses.

totes worth it.

Re:why should I adopt Python 3? (1)

strombrg (62192) | 1 year,28 days | (#44609461)

Programs tend to be international out of the box, because str is what unicode used to be.

try/except is no longer a programmer trap.

Tricks (1)

jameshofo (1454841) | 1 year,28 days | (#44609009)

Do you have any personal tricks or methods to learning new things, and what are the benefits/shortfalls or situations where it didn't work?

Import Everything (1)

g01d4 (888748) | 1 year,28 days | (#44609117)

A major reason I recently started to use Python is that there's so much already out there, for free, in terms of packages and support. Was this widespread adoption an original goal, a positive after-effect or logical outcome?

Immutable object properties (1)

kpdvx (546561) | 1 year,28 days | (#44609295)

Do you foresee adding first-class language support for immutable object variables? Something like Java's "final" for member variables. I understand that something could be done with a @decorator to implement this, but I'm interested in baked-in support.

Re:Immutable object properties (1)

n1ywb (555767) | 1 year,28 days | (#44609807)

If you want ALL the attributes to be read-only, you can use collections.namedtuple.

This sort of control over other developers is generally considered un-Pythonic because it violates the "we're all adults here" principle. If the documentation says "Don't assign to X", you know you are taking your chances when you do it. If you feel that you have a good enough reason to do it, bully for you, but don't complain when it breaks.

One feature Python already has which violates this principle is the '__' prefix name mangling. I've had the misfortune of working with a library where I really had a very good reason to change one of the "private" variables in a very safe way, but because the original developer had arbitrarily made ALL his attributes "__*", I had to fork the library and fix it first.

Python as a shell language (3, Interesting)

js_sebastian (946118) | 1 year,28 days | (#44609399)

Tools like ipython and fabric go a long way into making python into something that can replace my bash shell in many situations.

The main obstacle to this use-case is python's semantic spacing and lack of braces (or something):

- it is hard to do even a fairly simple if/else or loop in a single line so it will interact nicely with the terminal's history
- it is hard to cut&paste code into the terminal because you have to be wary of leading spaces

Ipython tries to solve some of this with shortcuts to bring up a built-in editor, which is an approach that works but is quite cumbersome.

Do you think convenient usage on the interactive shell is a worthy goal that the language should support? if so, is there any direction the language or libraries could develop to better support it?

GIL vs. Stackless model (1)

Mysticalfruit (533341) | 1 year,28 days | (#44609497)

Have you ever thought about merging some of the ideas of the Stackless python interpreter into some future version of python to make the whole argument mute?
I've played with stackless and depending on what you're doing it can leverage huge benefits.

If you were to design Python from scratch... (2, Interesting)

Anonymous Coward | 1 year,28 days | (#44609519)

Guido, if you were to design Python from scratch now (without any constraint and legacy code using the old Python), what would you change and how different would it be from Python 3?

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>