Hash Table, Christiania
(a table with many kinds of hash)
On 1/20/2015 12:19 PM, Devin Jeanpierre wrote:
There are similarly many kinds of hash tables.
For a given use case (e.g. a sorted dict, or a list with efficient
removal, etc.), there's a few data structures that make sense, and a
library
Stephen Hansen :
> On Tue, Jan 20, 2015 at 1:45 AM, Marko Rauhamaa wrote:
>> Terry Reedy :
>> > Others have answered as to why other special-purpose
>> > constrained-structure trees have not been added to the stdlib.
>>
>> Ordered O(log n) mappings are not special-purpose data structures. I'd
>>
Denis McMahon wrote:
> On Mon, 19 Jan 2015 16:12:57 -0800, Luke Tomaneng wrote:
>
>> I have been having a bit of trouble with the things mentioned in the
>> title.
>
> I've uploaded a slightly different approach to your code at:
>
> http://www.sined.co.uk/tmp/shop.py.txt
>
> def compute_bill(s
Peter Otten wrote:
> Denis McMahon wrote:
>> sold = {k:0 for k in shopping.keys()}
>
> There is also dict.from_keys()
Sorry, fromkeys():
>>> shopping = {'orange': 5, 'pear': 5, 'banana': 5, 'apple': 4}
>>> dict.fromkeys(shopping, 0)
{'banana': 0, 'orange': 0, 'apple': 0, 'pear': 0}
--
h
On Wednesday, January 21, 2015 at 1:27:39 PM UTC+5:30, Stephen Hansen wrote:
> On Tue, Jan 20, 2015 at 1:45 AM, Marko Rauhamaa wrote:
> Terry Reedy :
>
>
>
> > Others have answered as to why other special-purpose
>
> > constrained-structure trees have not been added to the stdlib.
>
>
>
> O
On Wed, Jan 21, 2015 at 11:09 PM, Rustom Mody wrote:
> I would like a set to be {1,2,3} or at worst ⦃1,2,3⦄
> and a bag to be ⟅1,2,3⟆
>
> Apart from the unicode niceness that Ive described here
> http://blog.languager.org/2014/04/unicoded-python.html
>
> Its a bit of a nuisance that we have to wri
On 2015-01-21 23:35, Chris Angelico wrote:
> On Wed, Jan 21, 2015 at 11:09 PM, Rustom Mody wrote
> > Its a bit of a nuisance that we have to write set([1,2,3]) for
> > the first
>
> Wait, what?
>
> rosuav@sikorsky:~$ python
> Python 2.7.3 (default, Mar 13 2014, 11:03:55)
> [GCC 4.7.2] on linux2
>
On Wed, Jan 21, 2015 at 11:55 PM, Tim Chase
wrote:
> On 2015-01-21 23:35, Chris Angelico wrote:
>> On Wed, Jan 21, 2015 at 11:09 PM, Rustom Mody wrote
>> > Its a bit of a nuisance that we have to write set([1,2,3]) for
>> > the first
>>
>> Looks like {1,2,3} works for me.
>
> That hasn't always wo
Hello Terry,
It is not play with words. A tree is a recursive - nested -
hierachical
data structure with the restriction of no cycles or alternate
pathways.
Python collections whose members are general objects, including
collections, can be nested. The resulting structures *are* tree
structures
On Wed, 21 Jan 2015 09:43:31 +0100, Peter Otten wrote:
> There is also dict.from_keys()
See, I learned something too.
> The inner loop is not just inefficient for stock sold in large
> quantities,
Agreed, but as for:
> it will fail for stock sold by weight, volume etc.
I was trying to stay tr
On 2015-01-22 00:01, Chris Angelico wrote:
> On Wed, Jan 21, 2015 at 11:55 PM, Tim Chase
>>> Looks like {1,2,3} works for me.
>>
>> That hasn't always worked:
>
> the argument's still fairly weak when it's alongside a pipe-dream
> desire to use specific mathematical Unicode characters in source
>
On Thu, Jan 22, 2015 at 1:26 AM, Tim Chase
wrote:
> While 2.0 is certainly antiquated, Red Hat Enterprise Linux (RHEL) is
> often considered the best definition of what's considered "oldest
> supported production environment". RHEL v4 ships with Py2.3 and one
> can still obtain extended support f
Rustom Mody wrote:
> On Wednesday, January 21, 2015 at 1:27:39 PM UTC+5:30, Stephen Hansen
> wrote:
[...]
> Among my teachers of CS, there were two – both brilliant — one taught me
> Numerical Analysis, the other taught me programming.
I wonder just how brilliant the Numerical Analysis guy really
On Wednesday, January 21, 2015 at 6:06:06 PM UTC+5:30, Chris Angelico wrote:
> On Wed, Jan 21, 2015 at 11:09 PM, Rustom Mody wrote:
> > I would like a set to be {1,2,3} or at worst ⦃1,2,3⦄
> > and a bag to be ⟅1,2,3⟆
> >
> > Apart from the unicode niceness that Ive described here
> > http://blog.l
> On Jan 21, 2015, at 12:06 AM, Denis McMahon wrote:
>
> On Tue, 20 Jan 2015 19:37:26 -0800, Chandrakant Tiwari wrote:
>
>> in the program below i want it to make it work the same way as TRACERT
>> command.
>
> As an observation, you're re-inventing a wheel that already works
> perfectly we
On Wed, Jan 21, 2015 at 7:47 AM, Steven D'Aprano
wrote:
>> More irksome that for the second we've to preface with
>>
>> from collections import Counter
>>
>> And still more a PITA that a straightforward standard name like bag (or
>> multiset) is called by such an ungoogleable misleading name as co
In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
Smalltalk Could Kill Ruby". (No cheering, that sort of attitude is one of
the things that killed Smalltalk.) Although Martin discusses Ruby, the
lessons could also apply to Python.
Video is available here:
http://www.youtube.com/
On Wed, Jan 21, 2015 at 9:15 AM, Ian Kelly wrote:
> class MultiSet(MutableSet):
In retrospect this probably shouldn't derive from MutableSet, since
that carries the expectation that all elements are unique (much like
how bool shouldn't be subclassed). For instance, collections.Set
includes some o
Hi Steven, you wrote:
> In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
> Smalltalk Could Kill Ruby".
I've yet to watch the video, I'll do that later tonight, but I also remember
what DHH said about Smalltalk in his FLOSS interview about Rails, with Randal
Schwartz, in July
On Sat, 17 Jan 2015 02:03:57 +1100, Chris Angelico wrote:
>Scenario: You're introducing someone to Python for the first time.
>S/he may have some previous programming experience, or may be new to
>the whole idea of giving a computer instructions. You have a couple of
>minutes to show off how awes
On 21-1-2015 18:59, Steve Hayes wrote:
> 3. When I started to look at it, I found that strings could be any length and
> were not limited to swomething arbitrary, like 256 characters.
Even more fun is that Python's primitive integer type (longs for older Python
versions)
has no arbitrary limita
On 2015-01-22 03:34, Steven D'Aprano wrote:
> In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
> Smalltalk Could Kill Ruby".
Holy pacing, Batman. Watching it at 2x leaves me wondering how much
of the stage was worn off during the presentation.
> And now it's all but dead. Why
On Friday, 16 January 2015 11:04:20 UTC-4, Chris Angelico wrote:
> Scenario: You're introducing someone to Python for the first time.
> S/he may have some previous programming experience, or may be new to
> the whole idea of giving a computer instructions. You have a couple of
> minutes to show of
On Thu, Jan 22, 2015 at 5:20 AM, Irmen de Jong wrote:
> On 21-1-2015 18:59, Steve Hayes wrote:
>
>> 3. When I started to look at it, I found that strings could be any length and
>> were not limited to swomething arbitrary, like 256 characters.
>
> Even more fun is that Python's primitive integer t
Chris,
Scenario: You're introducing someone to Python for the first time.
S/he may have some previous programming experience, or may be new to
the whole idea of giving a computer instructions. You have a couple of
minutes to show off how awesome Python is. What do you do?
Some ideas where give
On 2015-01-21, Steven D'Aprano wrote:
> In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
> Smalltalk Could Kill Ruby".
But does he answer the more important question "and can we use it to
kill PHP?".
--
Grant Edwards grant.b.edwardsYow! What UNIVERSE is
On Wednesday, 21 January 2015 15:06:33 UTC-4, Chris Angelico wrote:
> On Thu, Jan 22, 2015 at 5:20 AM, Irmen de Jong wrote:
> > On 21-1-2015 18:59, Steve Hayes wrote:
> >
> >> 3. When I started to look at it, I found that strings could be any length
> >> and
> >> were not limited to swomething a
On 01/21/2015 02:06 PM, Chris Angelico wrote:
> On Thu, Jan 22, 2015 at 5:20 AM, Irmen de Jong wrote:
>> On 21-1-2015 18:59, Steve Hayes wrote:
>>
>>> 3. When I started to look at it, I found that strings could be any length
>>> and
>>> were not limited to swomething arbitrary, like 256 character
On Thu, Jan 22, 2015 at 8:20 AM, Matthew Ruffalo wrote:
> Yes, length-unlimited strings are *extremely* useful in some
> applications. I remember bitterly cursing Java's string length limit of
> 2 ** 31 (maybe - 1) on multiple occasions. Python's strings seem to
> behave like integers in that thei
Chris Angelico writes:
> ..., and I would guess a 64-bit Java would
> also raise the limit.
Even in a 64-bit Java, the _type_ returned by String.length() is 'int',
and is thus at most (2**31 - 1). This isn't a problem for strings,
which never get that long in practice, but for some other Java da
On 01/21/2015 04:26 PM, Chris Angelico wrote:
> On Thu, Jan 22, 2015 at 8:20 AM, Matthew Ruffalo wrote:
>> Yes, length-unlimited strings are *extremely* useful in some
>> applications. I remember bitterly cursing Java's string length limit of
>> 2 ** 31 (maybe - 1) on multiple occasions. Python's
Alan Bawden writes:
> ... Score one for untyped languages.
Drat. I should have writted "dynamically typed languages".
The language has changed. When I was a novice Lisp hacker, we were
comfortable saying that Lisp was "untyped". But nowadays we always say
that Lisp is "dynamically typed". I
In article , alan@scooby-
doo.csail.mit.edu says...
> Even in a 64-bit Java, the _type_ returned by String.length() is
> 'int', and is thus at most (2**31 - 1). This isn't a problem for
> strings, which never get that long in practice, but for some other
> Java datatypes (e.g., Buffer) it is a rea
On Thu, Jan 22, 2015 at 8:46 AM, Matthew Ruffalo wrote:
> No, Java's String.length returns an int and Strings are limited to ~2 **
> 31 characters even in 64-bit Java.
Huh, annoying. In Python, the length of a string (in characters) is
stored in a Py_ssize_t (if I recall correctly), which is, I b
Rustom Mody writes:
> Thats not bfs. That's inorder traversal
Oops, you're right. How's this:
bfs x = go [x] where
go [] = []
go (L x:ts) = x:go ts
go (B x lst rst:ts) = x : go (ts ++ [lst, rst])
*Main> bfs t
[6,2,8,1,4,7,9,3,5]
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Jan 22, 2015 at 6:18 AM, Grant Edwards wrote:
> On 2015-01-21, Steven D'Aprano wrote:
>> In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
>> Smalltalk Could Kill Ruby".
>
> But does he answer the more important question "and can we use it to
> kill PHP?".
PHP won't die
Alan Bawden writes:
> The language has changed. When I was a novice Lisp hacker, we were
> comfortable saying that Lisp was "untyped". But nowadays we always say
> that Lisp is "dynamically typed". I could write an essay about why...
I'd be interested in seeing that. Lisp of course descends f
On Tue, Jan 20, 2015 at 6:23 PM, Rustom Mody wrote:
> The Haskell is bullseye¹ in capturing the essense of a tree because
> conceptually a tree of type t is recursive in the sense that it can contain
> 2 subtrees -- (B x lst rst) -- or its a base case -- L x.
How do you create a tree containing a
On 2015-01-21, Chris Angelico wrote:
> On Thu, Jan 22, 2015 at 6:18 AM, Grant Edwards
> wrote:
>> On 2015-01-21, Steven D'Aprano wrote:
>>> In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
>>> Smalltalk Could Kill Ruby".
>>
>> But does he answer the more important question "a
So I've got this python 3 script that needs to know if there is a
running DHCP daemon (ISC DHCP server) on the local system. Is there a
clean way to do this that (1) doesn't require me to do syscalls to local
utilities (like ps, top, etc), and (2) doesn't require any custom
modules (stock only)
On 01/21/2015 04:35 PM, Chris Angelico wrote:
> On Thu, Jan 22, 2015 at 6:18 AM, Grant Edwards
> wrote:
>> On 2015-01-21, Steven D'Aprano wrote:
>>> In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
>>> Smalltalk Could Kill Ruby".
>>
>> But does he answer the more important que
On Thu, Jan 22, 2015 at 10:06 AM, Jason Bailey wrote:
> So I've got this python 3 script that needs to know if there is a running
> DHCP daemon (ISC DHCP server) on the local system. Is there a clean way to
> do this that (1) doesn't require me to do syscalls to local utilities (like
> ps, top, et
On 01/21/2015 10:34 AM, Steven D'Aprano wrote:
> In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
> Smalltalk Could Kill Ruby". (No cheering, that sort of attitude is one of
> the things that killed Smalltalk.) Although Martin discusses Ruby, the
> lessons could also apply to Pyt
On Thu, Jan 22, 2015 at 10:19 AM, Anthony Papillion
wrote:
> To be fair, PHP has come a long way in the last few years and, I hear,
> there's movements within the community to make it better. Namespaces
> were a bit deal as were a few other things. Personally, while I am
> LOVING Python, I'd be sa
Steven D'Aprano writes:
> In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
> Smalltalk Could Kill Ruby"... http://www.youtube.com/watch?v=YX3iRjKj7C0
That's an hour-long video; could someone who's watched it give a brief
summary?
Meanwhile, there's this: http://prog21.dadgum
On 21-1-2015 20:06, Chris Angelico wrote:
> On Thu, Jan 22, 2015 at 5:20 AM, Irmen de Jong wrote:
>> On 21-1-2015 18:59, Steve Hayes wrote:
>>
>>> 3. When I started to look at it, I found that strings could be any length
>>> and
>>> were not limited to swomething arbitrary, like 256 characters.
>
On Thu, Jan 22, 2015 at 10:37 AM, Tim Daneliuk wrote:
> I find these kinds of discussions sort of silly. Once there is a critical
> mass of installed base, no language EVER dies.
Not sure about that. Back in the 1990s, I wrote most of my code in
REXX, either command-line or using a GUI toolkit l
On Thu, Jan 22, 2015 at 10:46 AM, Paul Rubin wrote:
> Meanwhile, there's this: http://prog21.dadgum.com/203.html
> "Retiring Python as a Teaching Language"
>
> tl;dr: he's switched to recommending Javascript as a first language
> instead of Python, since JS makes it easier to write graphics and g
On 01/21/2015 04:37 PM, Tim Daneliuk wrote:
> On 01/21/2015 10:34 AM, Steven D'Aprano wrote:
>> In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
>> Smalltalk Could Kill Ruby". (No cheering, that sort of attitude is one of
>> the things that killed Smalltalk.) Although Martin disc
In article ,
ros...@gmail.com says...
>
> Bad idea. Better to pick a language that makes it easy to get things
> right, and then work on the fun side with third-party libraries, than
> to tempt people in with "hey look how easy it is to do X" and then
> have them stuck with an inferior or flawed
In article <873873ae91@jester.gateway.sonic.net>,
no.email@nospam.invalid says...
>
> Steven D'Aprano writes:
> > In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
> > Smalltalk Could Kill Ruby"... http://www.youtube.com/watch?v=YX3iRjKj7C0
>
> That's an hour-long video;
On Wednesday, January 21, 2015 at 11:18:54 AM UTC-8, Grant Edwards wrote:
> On 2015-01-21, Steven D'Aprano wrote:
> > In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
> > Smalltalk Could Kill Ruby".
>
> But does he answer the more important question "and can we use it to
> kill
Grant Edwards :
> [At the time, a couple of us could stumble around with HTML enough to
> generate web pages that looked fresh out of 1995, but that was about
> it. The web pages in our older devices looked rather "retro" and had
> pretty limited functionality.]
I miss that plain old look of web
On Wednesday, January 21, 2015 at 4:10:08 PM UTC-8, Mario Figueiredo wrote:
> In article ,
> ros...@gmail.com says...
> >
> > Bad idea. Better to pick a language that makes it easy to get things
> > right, and then work on the fun side with third-party libraries, than
> > to tempt people in with
On Thu, Jan 22, 2015 at 11:09 AM, Mario Figueiredo wrote:
> "I want to become a programmer so I can make games" is, on the vast
> majority of cases, the quote of someone who will never become a
> programmer. Why should teachers reward that kind of thought?
How about "I want to become a programmer
Mario Figueiredo writes:
> "I want to become a programmer so I can make games" is, on the vast
> majority of cases, the quote of someone who will never become a
> programmer. Why should teachers reward that kind of thought?
I don't see what the problem is. Kids are interested in games and th
On 01/21/2015 05:36 PM, Chris Angelico wrote:
> On Thu, Jan 22, 2015 at 11:09 AM, Mario Figueiredo wrote:
>> "I want to become a programmer so I can make games" is, on the vast
>> majority of cases, the quote of someone who will never become a
>> programmer. Why should teachers reward that kind of
On Thu, Jan 22, 2015 at 12:38 PM, Paul Rubin wrote:
> Mario Figueiredo writes:
>> "I want to become a programmer so I can make games" is, on the vast
>> majority of cases, the quote of someone who will never become a
>> programmer. Why should teachers reward that kind of thought?
>
> I don't see
On Wednesday, January 21, 2015 at 10:34:40 AM UTC-6, Steven D'Aprano wrote:
> In 2009, Robert Martin gave a talk at RailsConf titled
> "What Killed Smalltalk Could Kill Ruby". (No cheering,
> that sort of attitude is one of the things that killed
> Smalltalk.) Although Martin discusses Ruby, the le
On Wed, Jan 21, 2015 at 3:06 PM, Jason Bailey wrote:
> So I've got this python 3 script that needs to know if there is a running
> DHCP daemon (ISC DHCP server) on the local system. Is there a clean way to
> do this that (1) doesn't require me to do syscalls to local utilities (like
> ps, top, etc
Chris Angelico writes:
> Either you pick up a super-restrictive "hey look, you can build a game
> with just point and click" system, which isn't teaching programming at
> all, or you end up getting bogged down in the massive details of what
> it takes to write code.
Code Hero ran into various obs
On Thu, Jan 22, 2015 at 1:53 PM, Paul Rubin wrote:
>> If someone's unfazed by the "it'll take you years before you can
>> actually write a saleable game" consideration,
>
> Wanting to write games is a completely different topic than wanting to
> sell them. It's just like any other creative outlet
On Thu, Jan 22, 2015 at 1:59 PM, Dennis Lee Bieber
wrote:
> To my mind, what killed REXX is that most operating systems just don't
> support its key feature well: ADDRESS targets!
>
> When the only target turns ADDRESS into the equivalent of os.system()
> (or some variant of popen(
On 2015-01-21 23:10, Grant Edwards wrote:
> I happily ignored PHP until a couple years back when we decided to
> use PHP for the web site on a small embedded Linux system.
[snip]
> I briefly considered trying to switch to Python, but the Python
> footprint is just too big...
Interesting that your
Mario Figueiredo wrote:
> In article ,
> ros...@gmail.com says...
>>
>> Bad idea. Better to pick a language that makes it easy to get things
>> right, and then work on the fun side with third-party libraries, than
>> to tempt people in with "hey look how easy it is to do X" and then
>> have them
How would I get a list of running processes with the subprocess module? The
documentation wasn't clear to me.
On Jan 21, 2015 7:21 PM, Dan Stromberg wrote:
On Wed, Jan 21, 2015 at 3:06 PM, Jason Bailey wrote:
> So I've got this python 3 script that needs to know if there is a running
> DHCP dae
On Thu, Jan 22, 2015 at 2:23 PM, Steven D'Aprano
wrote:
> What we need is more programmers with a passion for their job, and if that
> means learning to write games, then so be it. One of the problems with "9 to
> 5 code monkeys" is that programming is just a job for them. They do the
> absolute m
Occasionally you find people spreading Fear, Uncertainty, Doubt about
Python. Python is now over 20 years old and one of the most popular
languages in the world no matter how you measure popularity:
http://import-that.dreamwidth.org/1388.html
so you don't often get FUD these days. When you do,
On Thu, Jan 22, 2015 at 2:58 PM, Jason Bailey wrote:
> How would I get a list of running processes with the subprocess module? The
> documentation wasn't clear to me.
Using the ps command. :)
rosuav@dewey:~$ python3
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help",
Mario Figueiredo wrote:
> But speaking about impressing more experient programmers, I personally
> don't think Python has a wow factor in any of its features and syntax. At
> least in the way I understand the word "wow".
Quote:
I've seen Python criticized as "ugly" precisely because it doesn
On Thu, Jan 22, 2015 at 3:30 PM, Steven D'Aprano
wrote:
> C:
>
> double
> median_grouped (IterableOfReal data, double interval)
>
>
> (I may have taken some very slight liberties with the syntax, corrections or
> more idiomatic forms are very welcome.)
C doesn't really have iterables, so this
Alan Bawden wrote:
> Alan Bawden writes:
>> ... Score one for untyped languages.
>
> Drat. I should have writted "dynamically typed languages".
>
> The language has changed. When I was a novice Lisp hacker, we were
> comfortable saying that Lisp was "untyped". But nowadays we always say
> t
On Thu, Jan 22, 2015 at 10:55:27AM +1100, Chris Angelico wrote:
> Where's REXX today?
Still (somehow) alive in neo-Amiga platforms like AmigaOS4.x, MorphOS and AROS.
I know that's as good as dead but there are still people writing AREXX glue
code.
--
vag·a·bond adjective \ˈva-gə-ˌbänd\
a :
On Thursday, January 22, 2015 at 3:57:50 AM UTC+5:30, Paul Rubin wrote:
> Rustom Mody writes:
> > Thats not bfs. That's inorder traversal
>
> Oops, you're right. How's this:
>
> bfs x = go [x] where
> go [] = []
> go (L x:ts) = x:go ts
> go (B x lst rst:ts) = x : go (ts ++ [lst, rst])
>
On Thursday, January 22, 2015 at 4:25:03 AM UTC+5:30, Ian wrote:
> On Tue, Jan 20, 2015 at 6:23 PM, Rustom Mody wrote:
> > The Haskell is bullseye¹ in capturing the essense of a tree because
> > conceptually a tree of type t is recursive in the sense that it can contain
> > 2 subtrees -- (B x lst r
Steven D'Aprano writes:
> def median_grouped(data:Iterable[Real], interval:Real=1)->Real: ...
Wow, that's really nice. I had heard something about Python type hints
but hadn't seen them before.
> So how does Python's proposed type-hints compared to that used by other
> languages?
The most clo
On 1/21/2015 7:16 PM, Mario Figueiredo wrote:
In article <873873ae91@jester.gateway.sonic.net>,
no.email@nospam.invalid says...
Steven D'Aprano writes:
In 2009, Robert Martin gave a talk at RailsConf titled "What Killed
Smalltalk Could Kill Ruby"... http://www.youtube.com/watch?v=YX3iRjK
I don't think that Python is doomed. I *do* think that type-hinting is
useful, and Python has borrowed a syntax that is similar to that used in
other languages, so that it is a familiar one to many developers.
It is a stretch to call it intuitive though, either to write or to
read. Personally, I w
On Thu, Jan 22, 2015 at 4:50 PM, Nicholas Cole wrote:
> I would have preferred Python to mimic:
>
> Define function add taking price1, the price2, print_error equals true.
> Price1 is a float. Price2 is a float. The function returns a float.
>
> But now this is sounding a little like something fro
Paul Rubin writes:
> -spec median_grouped(iterable(real())) -> real().
Oops:
-spec median_grouped(iterable(real()), real()) -> real().
--
https://mail.python.org/mailman/listinfo/python-list
On 01/21/2015 08:30 PM, Steven D'Aprano wrote:
>
> So what is this unspeakable, nightmarish, cryptic abomination going to look
> like? Here's an example from PEP 484:
>
> def greeting(name: str) -> str:
> return 'Hello ' + name
>
>
> I don't know about you, but I think anyone who cannot re
On 22/01/2015 05:35, Paul Rubin wrote:
Steven D'Aprano writes:
def median_grouped(data:Iterable[Real], interval:Real=1)->Real: ...
Wow, that's really nice. I had heard something about Python type hints
but hadn't seen them before.
Currently flying here http://code.activestate.com/lists/py
On 22/01/2015 05:56, Chris Angelico wrote:
On Thu, Jan 22, 2015 at 4:50 PM, Nicholas Cole wrote:
I would have preferred Python to mimic:
Define function add taking price1, the price2, print_error equals true.
Price1 is a float. Price2 is a float. The function returns a float.
But now this is
On Wednesday, January 21, 2015 at 10:31:12 PM UTC-6, Steven D'Aprano wrote:
> Occasionally you find people spreading Fear, Uncertainty, Doubt about
> Python. Python is now over 20 years old and one of the most popular
> languages in the world no matter how you measure popularity:
What's next, ar
On 22/01/2015 02:11, Rick Johnson wrote:
On Wednesday, January 21, 2015 at 10:34:40 AM UTC-6, Steven D'Aprano wrote:
In 2009, Robert Martin gave a talk at RailsConf titled
"What Killed Smalltalk Could Kill Ruby". (No cheering,
that sort of attitude is one of the things that killed
Smalltalk.) Al
Rick Johnson writes:
>> def median_grouped(data:Iterable[Real], interval:Real=1)->Real: ...
>
> Nice! I like how the first "toy example" was less noisy,
> and then way down here you show us the real butt-uglyness of
> this "feature from hell"!
It looks fine to me. I'm still using Python 2.7 beca
On Wed, Jan 21, 2015 at 11:56 PM, Ian Kelly wrote:
> Since each element is associated with a node, the question could
> equally be phrased as "How do you create a tree containing an even
> number of elements under this constraint?"
Of course I meant to write "nodes" there, not "elements".
--
htt
On Wed, Jan 21, 2015 at 10:20 PM, Rustom Mody wrote:
> On Thursday, January 22, 2015 at 4:25:03 AM UTC+5:30, Ian wrote:
>> On Tue, Jan 20, 2015 at 6:23 PM, Rustom Mody wrote:
>> > The Haskell is bullseye¹ in capturing the essense of a tree because
>> > conceptually a tree of type t is recursive in
Ian Kelly writes:
> How do you create a tree containing an even number of elements under
> this constraint?
That's a good point, I've usually seen different definitions of trees,
e.g.
data Tree a = Leaf | Branch a (Tree a) (Tree a)
so a Leaf node doesn't have a value associated with it.
h
Ethan Furman wrote:
> On 01/21/2015 08:30 PM, Steven D'Aprano wrote:
>>
>> So what is this unspeakable, nightmarish, cryptic abomination going to
>> look like? Here's an example from PEP 484:
>>
>> def greeting(name: str) -> str:
>> return 'Hello ' + name
>>
>>
>> I don't know about you, b
On Thu, Jan 22, 2015 at 5:56 AM, Chris Angelico wrote:
> On Thu, Jan 22, 2015 at 4:50 PM, Nicholas Cole
> wrote:
>> I would have preferred Python to mimic:
>>
>> Define function add taking price1, the price2, print_error equals true.
>> Price1 is a float. Price2 is a float. The function returns
91 matches
Mail list logo