
Python 3.4 Beta 1 Released - alxv
http://python.org/download/releases/3.4.0/
======
taylorfausak
Wow, I haven't heard of pathlib [1] before now, but it looks awesome! In
particular, using the slash operator to join paths is brilliant.

    
    
        >>> p = PurePath('/etc')
        >>> p / 'init.d' / 'apache2'
        PurePosixPath('/etc/init.d/apache2')
    

[1]:
[http://docs.python.org/3.4/library/pathlib.html](http://docs.python.org/3.4/library/pathlib.html)

~~~
yareally
Scala does something similarly neat with using #| for piping system commands.

Slash for Scala is not used by default though for path joining, but it can be
by adding an implicit function:

    
    
      implicit def slash(str: String) = new { def /(joinStr: String) = str + java.io.File.separatorChar + joinStr} 
    
      val joinedStr = "abc"/"def"/"ghi"
      > joinedStr : java.lang.String = abc/def/ghi
    

Shell friendly syntax can be used for stdin/stdout in Scala as well (already
in the stdlib with no implicits required):

#< Redirect STDIN

#> Redirect STDOUT

#>> Append to STDOUT

#&& Create an AND list

#!! Create an OR list

[http://stackoverflow.com/questions/12772605/scala-shell-
comm...](http://stackoverflow.com/questions/12772605/scala-shell-commands-
with-pipe/12772628)

[http://alvinalexander.com/scala/scala-execute-exec-
external-...](http://alvinalexander.com/scala/scala-execute-exec-external-
system-commands-in-scala)

~~~
d0mine
There are Plumbum shell combinators in Python
[http://plumbum.readthedocs.org/en/latest/](http://plumbum.readthedocs.org/en/latest/)

~~~
voltagex_
There are a couple of modules that do this kind of thing but Plumbum looks
interesting, particularly

[http://plumbum.readthedocs.org/en/latest/local_commands.html...](http://plumbum.readthedocs.org/en/latest/local_commands.html#import-
hack)

>from plumbum.cmd import cat

>>cat('tmp.txt') #invokes cat tmp.txt on the system

------
computerhead
Been using python for 7+ years now. Does everyone really think people are
willing to adopt 3.x anything...? The reality of it is every place I have
worked (and currently working at). Is bound by 3rd party tools and what ever
interpreter they built against. Mostly that 2.6,2.7 right now. And it does not
look like anyone will be switching anytime soon.

Features look great, cant wait to "play" with them. But that;s about all.
Play.

~~~
willvarfar
I don't understand why you are being downvoted for your data-point. I've not
seen 3.x used anywhere in anger either. But I've seen plenty of people
embarking on new 2.7 projects. That's just my data-point too.

~~~
vdaniuk
I understand why GP is being downvoted. He presents his anecdote as a general
trend, dismissing python3 and its features as play without providing proofs.

------
makmanalp
> a new C API for implementing custom memory allocators

Wow. This'll lead to some interesting hacks, I think.

~~~
amirouche
Finally all the hacks done internaly by some big Python company is released in
the wild and not by them. Check out the presentation by the creator (in
french) [https://github.com/haypo/conf/blob/master/2013-PyconFR-
Stras...](https://github.com/haypo/conf/blob/master/2013-PyconFR-
Strasbourg/tracemalloc.pdf)

~~~
haypo
I started the development of tracemalloc at Wyplay, but I rewrote all the code
for the version included in Python 3.4: complelty different API, you get
different data, new implementation, etc. The old code:
[https://github.com/wyplay/pytracemalloc/](https://github.com/wyplay/pytracemalloc/)

The PEP 445 (malloc API) also allows to plug hooks on memory allocators at
runtime, instead of having to recompile Python for that.

------
the1
isn't 2.7 the best python still because twisted?

~~~
simonw
The most exciting feature in 3.4 (at least in my opinion) is the addition of
asyncio to the standard library, which aims to provide a standard event loop
which libraries like Twisted can then use to make themselves interoperable
with other async Python solutions:

[http://www.python.org/dev/peps/pep-3156/](http://www.python.org/dev/peps/pep-3156/)

"The event loop is the place where most interoperability occurs. It should be
easy for (Python 3.3 ports of) frameworks like Twisted, Tornado, or even
gevents to either adapt the default event loop implementation to their needs
using a lightweight adapter or proxy, or to replace the default event loop
implementation with an adaptation of their own event loop implementation.
(Some frameworks, like Twisted, have multiple event loop implementations. This
should not be a problem since these all have the same interface.)"

