Re: Python is DOOMED! Again!

2015-01-23 Thread Steven D'Aprano
Rick Johnson wrote: > On Thursday, January 22, 2015 at 10:23:48 PM UTC-6, Steven D'Aprano wrote: >> Rick Johnson wrote: >> >> > The solution is move the type hinting syntax completely >> > out of the source file and into another file -- think of >> > it as a "Python Type Hinting Header File". >>

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 5:36 PM, Steven D'Aprano wrote: > Chris Angelico wrote: > >> But having just watched a PyCon talk about PyPy and RPython >> and type inference > > Ooh! Got a link? Well, it's not primarily about type inference, but the matter is mentioned. It's mainly about PyPy, RPython,

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Steven D'Aprano
Chris Angelico wrote: > But having just watched a PyCon talk about PyPy and RPython > and type inference Ooh! Got a link? -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is DOOMED! Again!

2015-01-23 Thread Steven D'Aprano
Chris Angelico wrote: > On Fri, Jan 23, 2015 at 9:59 PM, Steven D'Aprano > wrote: >> (Don't use binary floating point numbers for anything related to money. >> Just don't.) > > While I generally agree, it's not quite as hard-and-fast as that. It's > just important to know that binary floating p

Alternative to multi-line lambdas: Assign-anywhere def statements

2015-01-23 Thread Chris Angelico
In some random and rambling discussion about Python, the notion came up that multi-line lambda functions are often sought as a means of populating dictionaries and other such structures. Conceptually, "def foo(...): ..." is broadly equivalent to "foo = FunctionType(...)"; but the only type of assig

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Steven D'Aprano
Fetchinson . wrote: > On 1/23/15, Steven D'Aprano wrote: [...] >> Cobra is especially close to Python-like syntax, and supports unit tests >> as well: >> >> >> def sqroot(i as int) as float >> require >>i > 0 >> ensure >>result > 0 >> tests >>

Re: Python is DOOMED! Again!

2015-01-23 Thread Steven D'Aprano
Sturla Molden wrote: > On 23/01/15 04:53, Steven D'Aprano wrote: > >> If your manager is so bad, why isn't he insisting that you program in PHP >> or Java or Algol 68 [insert name of some language you dislike] instead of >> Python? Is your bad manager forcing you to write Java-style code in >> Py

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 4:01 PM, Steven D'Aprano wrote: > # Untested > class B4(IntEnum): > F1 = 0 > F2 = 1 > F3 = 2 > T = 3 > def __bool__(self): > return self is B4.T > def __str__(self): > if self is B4.F1: return "Certainly False" > if self is B

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 4:29 PM, Steven D'Aprano wrote: > Sufficiently clever type-checkers may use assertions to infer types, but > requiring this is a non-starter. Or they could use the isinstance checks themselves to infer types. def func(arg): if not isinstance(arg, int): raise ValueErro

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Steven D'Aprano
Marko Rauhamaa wrote: > I seem to remember an idea floated on the Scheme mailing list of using > assertions for such a purpose: > >def myfunction(arg1, arg2): >assert isinstance(arg1, str) and isinstance(arg2, int) >return True > > The advantage is that the assertions can be

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Steven D'Aprano
Rustom Mody wrote: > On Friday, January 23, 2015 at 10:22:06 PM UTC+5:30, Ian wrote: >> On Fri, Jan 23, 2015 at 8:31 AM, Rustom Mody wrote: >> > Can you tell me what of the following code does not satisfy your >> > requirements? >> > [Needs python 3.4] >> > >> > >> from enum import IntEnum >>

Re: kivy secret of mana game

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 3:53 PM, Steven D'Aprano wrote: > I had fun once. It was horrible. You probably had it boiled. The proper way to have fun is fried in garlic butter, with a bit of salt. Try having some real home-cooked fresh fun, I think you'll like it. ChrisA -- https://mail.python.org/

Re: kivy secret of mana game

2015-01-23 Thread Steven D'Aprano
sohcahto...@gmail.com wrote: > On Friday, January 23, 2015 at 10:10:08 AM UTC-8, Tony the Tiger wrote: >> On Thu, 22 Jan 2015 17:13:12 +, Automn wrote: >> >> > game >> >> No interest, at all, nada, zilch. zero, nothing. >> >> /Grrr > > Why don't you like fun? I had fun once. It was horr

Re: kivy secret of mana game

2015-01-23 Thread Rustom Mody
On Saturday, January 24, 2015 at 9:36:56 AM UTC+5:30, Rustom Mody wrote: > On Thursday, January 22, 2015 at 10:43:30 PM UTC+5:30, Automn wrote: > > Hello, > > > > I am programming a "Secret of Mana" (Seiken Densetsu) game in kivy, it runs > > on a phone with kivy launcher. > > > > Features for no

Re: kivy secret of mana game

2015-01-23 Thread Rustom Mody
On Thursday, January 22, 2015 at 10:43:30 PM UTC+5:30, Automn wrote: > Hello, > > I am programming a "Secret of Mana" (Seiken Densetsu) game in kivy, it runs > on a phone with kivy launcher. > > Features for now are : movement by swiping, polygon collision and image state > changes with resource

Re: multiprocessing.Queue & vim python interpreter

2015-01-23 Thread Cameron Simpson
On 18Jan2015 16:20, unknown3...@gmail.com wrote: I am experimenting on a fork of vim-plug for managing vim plugins. I wanted to add parallel update support for python since ruby isn't nearly as common. I've come across a weird bug that only seems to happen when I'm inside vim, I'm wondering i

Re: Random ALL CAPS posts on this group

2015-01-23 Thread Rick Johnson
On Friday, January 23, 2015 at 6:05:02 AM UTC-6, Chris Angelico wrote: > It's definitely not "state vs non-state". Freedom of > expression should allow me to say anything I like in my > own home I also hereby declare that man should be free to ponder thoughts in his own mind, and sing in his own s

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Rustom Mody
On Friday, January 23, 2015 at 11:35:49 PM UTC+5:30, Ian wrote: > On Fri, Jan 23, 2015 at 10:03 AM, Rustom Mody wrote: > > On Friday, January 23, 2015 at 10:22:06 PM UTC+5:30, Ian wrote: > >> On Fri, Jan 23, 2015 at 8:31 AM, Rustom Mody wrote: > >> > Can you tell me what of the following code does

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Rustom Mody
On Friday, January 23, 2015 at 11:35:49 PM UTC+5:30, Ian wrote: > On Fri, Jan 23, 2015 at 10:03 AM, Rustom Mody wrote: > > On Friday, January 23, 2015 at 10:22:06 PM UTC+5:30, Ian wrote: > >> On Fri, Jan 23, 2015 at 8:31 AM, Rustom Mody wrote: > >> > Can you tell me what of the following code does

Re: Python is DOOMED! Again!

2015-01-23 Thread Rick Johnson
On Thursday, January 22, 2015 at 10:23:48 PM UTC-6, Steven D'Aprano wrote: > Rick Johnson wrote: > > > The solution is move the type hinting syntax completely > > out of the source file and into another file -- think of > > it as a "Python Type Hinting Header File". > > The 1970s called, they wan

Re: Python is DOOMED! Again!

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 12:00 PM, Sturla Molden wrote: > But without a thriving community, Python has no value to me. > > If we add type hinting, then that community will go away, because other > languages are better options. > > Who will win? Julia? Ruby? They are all waiting in line for Python t

Re: Random ALL CAPS posts on this group

2015-01-23 Thread Terry Reedy
On 1/23/2015 5:40 PM, sohcahto...@gmail.com wrote: On Monday, January 19, 2015 at 4:16:13 PM UTC-8, Luke Tomaneng wrote: Has anyone noticed these? There have been about three of them recently and they don't seem to have anything to do with Python at all. Does anyone know if there is a good rea

Re: Python is DOOMED! Again!

2015-01-23 Thread Sturla Molden
On 23/01/15 04:53, Steven D'Aprano wrote: If your manager is so bad, why isn't he insisting that you program in PHP or Java or Algol 68 [insert name of some language you dislike] instead of Python? Is your bad manager forcing you to write Java-style code in Python, or insisting on Hungarian Nota

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Marko Rauhamaa
Mario Figueiredo : > Much better is: > > def myfunction(arg1, arg2): > """ > Normal docstring... > @typehint: (str, int) -> bool > """ > return True I seem to remember an idea floated on the Scheme mailing list of using assertions for such a purpose: d

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Rick Johnson
On Friday, January 23, 2015 at 4:42:51 PM UTC-6, Mario Figueiredo wrote: > I'd rather it'd be a docstring parameter. > > - Decorators are transformation tools. Which type hints > are not. Valid point. > - keywords should be few and used only for language > features. Static analysis isn't and shou

Re: Check for running DHCP daemon?

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 10:21 AM, wrote: > On Friday, January 23, 2015 at 2:50:12 PM UTC-8, Chris Angelico wrote: >> On Sat, Jan 24, 2015 at 9:38 AM, wrote: >> > Secondly, even if you find a module, keep in mind that the module probably >> > won't stay in Python land. It will probably call an

Re: Check for running DHCP daemon?

2015-01-23 Thread sohcahtoa82
On Friday, January 23, 2015 at 2:50:12 PM UTC-8, Chris Angelico wrote: > On Sat, Jan 24, 2015 at 9:38 AM, wrote: > > Secondly, even if you find a module, keep in mind that the module probably > > won't stay in Python land. It will probably call an external utility > > itself. > > > > If you RE

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Mario Figueiredo
In article , sohcahto...@gmail.com says... > > > def myfunction(arg1, arg2): > > """ > > Normal docstring... > > @typehint: (str, int) -> bool > > """ > > return True > > > > I really like that implementation. > > Its unobtrusive and doesn't clutter th

Re: What killed Smalltalk could kill Python

2015-01-23 Thread Emile van Sebille
On 1/23/2015 2:48 PM, sohcahto...@gmail.com wrote: On Thursday, January 22, 2015 at 9:39:53 PM UTC-8, alex23 wrote: I seem to recall an interview with someone from Blizzard Entertainment mentioning that the first Warcraft game (Released in 1994) was developed by passing around floppy disks w

Re: What killed Smalltalk could kill Python

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 9:51 AM, Tim Daneliuk wrote: > On 01/21/2015 05:55 PM, Chris Angelico wrote: >> 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

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread sohcahtoa82
On Friday, January 23, 2015 at 2:46:01 PM UTC-8, Mario Figueiredo wrote: > In article , mar...@gmail.com > says... > > > > > > So I'd rather see: > > > > def myfunction(arg1, arg2): > > """ > > Normal docstring. > > """ > > "@typehint: (str, int) -> bool" > >

Re: What killed Smalltalk could kill Python

2015-01-23 Thread Tim Daneliuk
On 01/21/2015 05:55 PM, Chris Angelico wrote: > 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

Re: What killed Smalltalk could kill Python

2015-01-23 Thread sohcahtoa82
On Thursday, January 22, 2015 at 9:39:53 PM UTC-8, alex23 wrote: > On 22/01/2015 1:23 PM, Steven D'Aprano wrote: > > Modern games *are* part of "today's complex application systems", and games > > developers may need the same skills used by "serious developers" > > I wish more game developers woul

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Mario Figueiredo
In article , mar...@gmail.com says... > > > So I'd rather see: > > def myfunction(arg1, arg2): > """ > Normal docstring. > """ > "@typehint: (str, int) -> bool" > return True > Actually that is idiotic. Much better is: def myfunction(arg1, arg2):

Re: Check for running DHCP daemon?

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 9:38 AM, wrote: > Secondly, even if you find a module, keep in mind that the module probably > won't stay in Python land. It will probably call an external utility itself. > > If you REALLY wanted to check it without calling an external utility, you > could connect to p

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Mario Figueiredo
In article <4b3b498a-c9b0-443d-8514-87ccd8e98...@googlegroups.com>, rantingrickjohn...@gmail.com says... > > (Example modified for PEP8 compliance ;-) > > @typehint(arg1:str, arg2:int, returns:bool) > def myfunction(arg1, arg2): > return True > > Of course "@typehi

Re: Random ALL CAPS posts on this group

2015-01-23 Thread sohcahtoa82
On Monday, January 19, 2015 at 4:16:13 PM UTC-8, Luke Tomaneng wrote: > Has anyone noticed these? There have been about three of them recently and > they don't seem to have anything to do with Python at all. Does anyone know > if there is a good reason they are here? My question is, does anyone

Re: Check for running DHCP daemon?

2015-01-23 Thread sohcahtoa82
On Friday, January 23, 2015 at 2:07:04 PM UTC-8, Jason Bailey wrote: > Is there a way to do it without calling external utilities (i.e. a > Python module, etc)? I'd rather stay within the realm of Python if possible. > > Jason > > > > On 01/23/2015 10:04 AM, Chris Angelico wrote: > > On Sat, J

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Rick Johnson
On Friday, January 23, 2015 at 3:13:12 PM UTC-6, Mario Figueiredo wrote: > In article <12d74fb6-f7d7-4ff0-88d3-6076a5dc7...@googlegroups.com>, > Sir Richard Johnson The First says... > > > > Injecting polarity into debates is dangerous, because, > > then we get off into the emotional weeds and a

Re: Check for running DHCP daemon?

2015-01-23 Thread Jason Bailey
Is there a way to do it without calling external utilities (i.e. a Python module, etc)? I'd rather stay within the realm of Python if possible. Jason On 01/23/2015 10:04 AM, Chris Angelico wrote: On Sat, Jan 24, 2015 at 3:02 AM, Jason Bailey wrote: I'm actually wondering if it might be mor

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Rick Johnson
On Friday, January 23, 2015 at 3:02:57 PM UTC-6, Mario Figueiredo wrote: > In any case, I agree entirely with you that type > annotation is one ugly syntax to a programming language > that is touted everywhere as being simple and easy to > read. I would say that the mistake started 5 years ago, >

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Mario Figueiredo
In article <12d74fb6-f7d7-4ff0-88d3-6076a5dc7...@googlegroups.com>, rantingrickjohn...@gmail.com says... > > Injecting polarity into debates is dangerous, because, then > we get off into the emotional weeds and a solution may never > be found -- just observe the polarization of American > politic

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Fetchinson .
On 1/23/15, Chris Angelico wrote: > On Sat, Jan 24, 2015 at 12:23 AM, Fetchinson . > wrote: >> In any case, I'm pretty sure it was said before, but I can't really >> find it anywhere, can someone tell me what the rationale is for >> *function signature* type hinting? >> >> I totally get type hint

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Mario Figueiredo
In article <5afad59b-5e8c-4821-85cf-9e971c8c7...@googlegroups.com>, rantingrickjohn...@gmail.com says... > > On Thursday, January 22, 2015 at 10:04:29 PM UTC-6, Chris Angelico wrote: > > > It's worth pointing out, too, that the idea isn't > > panaceaic - it's just another tool in the box. Any ti

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Rick Johnson
On Friday, January 23, 2015 at 1:59:38 PM UTC-6, Chris Angelico wrote: > On Sat, Jan 24, 2015 at 6:48 AM, Sir Rick Johnson wrote: > > On Thursday, January 22, 2015 at 10:04:29 PM UTC-6, Chris Angelico wrote: > > > >> It's worth pointing out, too, that the idea isn't > >> panaceaic - it's just anoth

Re: kivy secret of mana game

2015-01-23 Thread sohcahtoa82
On Friday, January 23, 2015 at 10:10:08 AM UTC-8, Tony the Tiger wrote: > On Thu, 22 Jan 2015 17:13:12 +, Automn wrote: > > > game > > No interest, at all, nada, zilch. zero, nothing. > > /Grrr Why don't you like fun? -- https://mail.python.org/mailman/listinfo/python-list

Re: Random ALL CAPS posts on this group

2015-01-23 Thread Ben Finney
Steven D'Aprano writes: > Ben Finney wrote: > > > Freedom of expression entails an obligation on the state to not > > quash anyone's expression. It does not affect anyone who is not the > > state; it imposes no obligation on the PSF. > > By this reasoning, you would be perfectly comfortable with

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Rick Johnson
On Friday, January 23, 2015 at 7:23:34 AM UTC-6, Fetchinson . wrote: > I really like the idea that in python I don't have lots of > choices in many areas, certain things are dictated. The > big advantage is that when I read other people's code I > know what to expect so me being restricted is a sma

Re: [OT] absolute vs. relative URI

2015-01-23 Thread Mark Lawrence
On 23/01/2015 19:46, Chris Angelico wrote: On Sat, Jan 24, 2015 at 6:02 AM, Rick Johnson wrote: It's not deprecated, and never will be; Chris, what do you call a statement that is based on an un-provable premise? Oh and, GvR told me to tell you that he wants his time machine back, and if it h

Re: Random ALL CAPS posts on this group

2015-01-23 Thread Ben Finney
Steven D'Aprano writes: > Ben Finney wrote: > > > Freedom of expression entails an obligation on the state to not > > quash anyone's expression. It does not affect anyone who is not the > > state; it imposes no obligation on the PSF. > > By this reasoning, you would be perfectly comfortable with

Re: Case-insensitive sorting of strings (Python newbie)

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 6:14 AM, Marko Rauhamaa wrote: > Well, if Python can't, then who can? Probably nobody in the world, not > generically, anyway. > > Example: > > >>> print("re\u0301sume\u0301") > résumé > >>> print("r\u00e9sum\u00e9") > résumé > >>> print("re\u0301sume\u0

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 6:48 AM, Rick Johnson wrote: > On Thursday, January 22, 2015 at 10:04:29 PM UTC-6, Chris Angelico wrote: > >> It's worth pointing out, too, that the idea isn't >> panaceaic - it's just another tool in the box. Any time >> you break related things into separate places, espec

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Rick Johnson
On Thursday, January 22, 2015 at 10:04:29 PM UTC-6, Chris Angelico wrote: > It's worth pointing out, too, that the idea isn't > panaceaic - it's just another tool in the box. Any time > you break related things into separate places, especially > separate files, the tendency for them to get out of

Re: [OT] absolute vs. relative URI

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 6:02 AM, Rick Johnson wrote: >> It's not deprecated, and never will be; > > Chris, what do you call a statement that is based on an > un-provable premise? Oh and, GvR told me to tell you that he > wants his time machine back, and if it has even one dent > you're going to be

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Rick Johnson
On Thursday, January 22, 2015 at 9:24:01 PM UTC-6, Rustom Mody wrote: > > > > Simplistic Example Code utilizing two files: > > > > > > [...snip code example...] > >

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Rick Johnson
On Thursday, January 22, 2015 at 9:22:40 PM UTC-6, Terry Reedy wrote: > On 1/22/2015 8:15 PM, Rick Johnson wrote: > > > Okay, i have found a solution to the type hinting problem > > that will appease both sides. On one side we have those who > > are proposing type hinting annotations within functi

Re: Case-insensitive sorting of strings (Python newbie)

2015-01-23 Thread Marko Rauhamaa
Peter Otten <__pete...@web.de>: > The standard recommendation is to convert bytes to unicode as early as > possible and only manipulate unicode. Unicode doesn't get you off the hook (as you explain later in your post). Upper/lowercase as well as collation order is ambiguous. Python even with dece

Re: [OT] absolute vs. relative URI

2015-01-23 Thread Rick Johnson
On Friday, January 23, 2015 at 11:49:05 AM UTC-6, Chris Angelico wrote: > On Sat, Jan 24, 2015 at 3:00 AM, Chris Warrick wrote: > > 5. especially old-style %-based string formatting! > > Please. There's nothing wrong with %-style formatting. *BALD-FACED-PARTISAN-LIE*! If there is *NOTHING* wr

Re: Loading a module from a subdirectory

2015-01-23 Thread Ian Kelly
On Fri, Jan 23, 2015 at 11:23 AM, Automn wrote: > On 2014-03-10, Virgil Stokes wrote: >> [SNIP] > > I don't think you understand what Mr. Otten said, it is not undefined > behaviour, > maybe you could demangle your import statement. The post you're replying to is 10 months old. One way or anoth

Re: Loading a module from a subdirectory

2015-01-23 Thread Automn
On 2014-03-10, Virgil Stokes wrote: > This is a multi-part message in MIME format. > --030903060901020503030004 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > I have the following folder-file structure: > > C:/PythonCode/VideoPlaye

Re: kivy secret of mana game

2015-01-23 Thread Ethan Furman
On 01/22/2015 09:13 AM, Automn wrote: > > I am programming a "Secret of Mana" (Seiken Densetsu) game in kivy, it runs > on a phone with kivy launcher. AWESOME That was a totally fabulous game -- one of the very few I actually played to the end. :) -- ~Ethan~ signature.asc Description:

Re: kivy secret of mana game

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 5:09 AM, Tony the Tiger wrote: > On Thu, 22 Jan 2015 17:13:12 +, Automn wrote: > >> game > > No interest, at all, nada, zilch. zero, nothing. > > /Grrr Then don't bother responding, just skip the thread and move on. The rest of us, who don't have this unnatural avers

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Ian Kelly
On Fri, Jan 23, 2015 at 10:45 AM, Rustom Mody wrote: > No disagreement with the 'hack' > As for "no use case for equal but distinct tokens" - thats a strange > view given this thread If you want equal but distinct, you can give them distinct values and define an __eq__ method that compares them a

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Ian Kelly
On Fri, Jan 23, 2015 at 10:03 AM, Rustom Mody wrote: > On Friday, January 23, 2015 at 10:22:06 PM UTC+5:30, Ian wrote: >> On Fri, Jan 23, 2015 at 8:31 AM, Rustom Mody wrote: >> > Can you tell me what of the following code does not satisfy your >> > requirements? >> > [Needs python 3.4] >> > >> >

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 4:45 AM, Rustom Mody wrote: > No disagreement with the 'hack' > As for "no use case for equal but distinct tokens" - thats a strange > view given this thread Look at it this way: A classic enumeration has no use-case for equal-but-distinct; this thread doesn't disagree wit

Re: Case-insensitive sorting of strings (Python newbie)

2015-01-23 Thread Steven D'Aprano
John Sampson wrote: > I notice that the string method 'lower' seems to convert some strings > (input from a text file) to Unicode but not others. I don't think so. You're going to have to show an example. I *think* what you might be running into is an artifact of printing to a terminal, which ma

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Ian Kelly
On Fri, Jan 23, 2015 at 4:46 AM, Andrew Robinson wrote: > Although, I have to laugh -- Verilog can syntheze a CPU -- implement memory > -- and then load a program and run python on the virtual machine. When the > pentium was first developed, I watched as Intel actually booted up MS-DOS > under u

Re: Case-insensitive sorting of strings (Python newbie)

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 4:53 AM, Peter Otten <__pete...@web.de> wrote: > Now the same with unicode. To read text with a specific encoding use either > codecs.open() or io.open() instead of the built-in (replace utf-8 with your > actual encoding): > import io for line in io.open("tmp.txt",

Re: [OT] absolute vs. relative URI

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 1:47 AM, Grant Edwards wrote: > I'm maintaining a web app were the original author(s) went to a little > bit of trouble to always use absolute URIs in links in the pages. The advantage is that someone who downloads the bare page will still be referencing images, CSS, other

Re: Case-insensitive sorting of strings (Python newbie)

2015-01-23 Thread Peter Otten
John Sampson wrote: > I notice that the string method 'lower' seems to convert some strings > (input from a text file) to Unicode but not others. > This messes up sorting if it is used on arguments of 'sorted' since > Unicode strings come before ordinary ones. > > Is there a better way of case-in

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Rustom Mody
On Friday, January 23, 2015 at 11:07:48 PM UTC+5:30, Chris Angelico wrote: > On Sat, Jan 24, 2015 at 4:22 AM, Rustom Mody wrote: > > Strikes me that making enumerations is-equal rather than just > > =-equal is a bit heavy-handed and unnecessary > > What do you think? > > *Normal* use of an enumer

Re: [OT] absolute vs. relative URI

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 3:00 AM, Chris Warrick wrote: > 5. especially old-style %-based string formatting! Please. There's nothing wrong with %-style formatting. It's not deprecated, and never will be; and it has the advantage of being cross-language compatible. I was speaking with a Python stude

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 4:22 AM, Rustom Mody wrote: > Strikes me that making enumerations is-equal rather than just > =-equal is a bit heavy-handed and unnecessary > What do you think? *Normal* use of an enumeration does make sense for them to be identical. Classic use would be like this: class

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Rustom Mody
On Friday, January 23, 2015 at 10:54:06 PM UTC+5:30, Chris Angelico wrote: > On Sat, Jan 24, 2015 at 4:03 AM, Rustom Mody wrote: > > The only workaround I have been able to come up with is: > > > > class B4(IntEnum): > >> F1 = 0 > >> F2 = "" > >> F3 = None > >> T =

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Rustom Mody
On Friday, January 23, 2015 at 10:22:06 PM UTC+5:30, Ian wrote: > On Fri, Jan 23, 2015 at 8:31 AM, Rustom Mody wrote: > > Can you tell me what of the following code does not satisfy your > > requirements? > > [Needs python 3.4] > > > > > from enum import IntEnum > class B4(IntEnum): > >

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 4:03 AM, Rustom Mody wrote: > The only workaround I have been able to come up with is: > > class B4(IntEnum): >> F1 = 0 >> F2 = "" >> F3 = None >> T = 1 > > which is not bad; its ridiculous It's ridiculous because you declared an IntEnum an

Re: [OT] absolute vs. relative URI

2015-01-23 Thread Grant Edwards
On 2015-01-23, Chris Warrick wrote: > > Hah! Those people certainly don’t look “experienced”. > >"https://mail.python.org/mailman/listinfo/python-list

Re: Case-insensitive sorting of strings (Python newbie)

2015-01-23 Thread Michael Ströder
John Sampson wrote: > I notice that the string method 'lower' seems to convert some strings (input > from a text file) to Unicode but not others. > This messes up sorting if it is used on arguments of 'sorted' since Unicode > strings come before ordinary ones. I doubt that. Can you provide a short

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 12:23 AM, Fetchinson . wrote: > In any case, I'm pretty sure it was said before, but I can't really > find it anywhere, can someone tell me what the rationale is for > *function signature* type hinting? > > I totally get type hinting in general, but why does it have to be i

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Rustom Mody
On Friday, January 23, 2015 at 10:22:06 PM UTC+5:30, Ian wrote: > On Fri, Jan 23, 2015 at 8:31 AM, Rustom Mody wrote: > > Can you tell me what of the following code does not satisfy your > > requirements? > > [Needs python 3.4] > > > > > from enum import IntEnum > class B4(IntEnum): > >

Re: Check for running DHCP daemon?

2015-01-23 Thread Chris Angelico
On Sat, Jan 24, 2015 at 3:02 AM, Jason Bailey wrote: > I'm actually wondering if it might be more beneficial for me to check if the > local DHCP port (udp 67) is bound and in use. I had tried to do this some > time ago, and couldn't get it working right (it would always test true, even > when it s

Case-insensitive sorting of strings (Python newbie)

2015-01-23 Thread John Sampson
I notice that the string method 'lower' seems to convert some strings (input from a text file) to Unicode but not others. This messes up sorting if it is used on arguments of 'sorted' since Unicode strings come before ordinary ones. Is there a better way of case-insensitive sorting of strings i

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Ian Kelly
On Fri, Jan 23, 2015 at 8:31 AM, Rustom Mody wrote: > Can you tell me what of the following code does not satisfy your requirements? > [Needs python 3.4] > > from enum import IntEnum class B4(IntEnum): > F1 = 0 > F2 = 0 > F3 = 0 > T = 1 This strikes me a

Re: Python is DOOMED! Again!

2015-01-23 Thread Ian Kelly
On Thu, Jan 22, 2015 at 7:59 PM, Rustom Mody wrote: > PS Ian for a hot thread like this its good to put quotes carefully > You are quoting Steven quoting somebody -- dunno who that somebody is I include quote that only for context to Steven's quote. Since I'm not replying to it, I don't care who

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Terry Reedy
On 1/23/2015 6:46 AM, Andrew Robinson wrote: -- because people seem to have a very wrong idea about bool's nature as a dualton being somehow justified solely by the fact that there are only two values in Boolean logic; For, singletons style programming is not justified by the number of values an

Re: Check for running DHCP daemon?

2015-01-23 Thread Jason Bailey
Hmm, okay. What you are saying makes sense. I'm actually wondering if it might be more beneficial for me to check if the local DHCP port (udp 67) is bound and in use. I had tried to do this some time ago, and couldn't get it working right (it would always test true, even when it shouldn't have

Re: [OT] absolute vs. relative URI

2015-01-23 Thread Chris Warrick
On Fri, Jan 23, 2015 at 4:40 PM, Grant Edwards wrote: > On 2015-01-23, Marko Rauhamaa wrote: >> Grant Edwards : >> >>> I'm not an HTLM/HTTP guru, but I've tinkered with web pages for 20+ >>> years, and for links within sites, I've always used links either >>> relative to the current location or a

Re: kivy secret of mana game

2015-01-23 Thread Automn
On 2015-01-22, Ian Kelly wrote: > On Thu, Jan 22, 2015 at 10:13 AM, Automn wrote: >> The graphics have been licensed for this. > > Really? I'm surprised Square-Enix would even give consideration to > licensing something like this. The graphics have all been purchased. I forgot to tell that the g

Re: [OT] absolute vs. relative URI

2015-01-23 Thread Grant Edwards
On 2015-01-23, Marko Rauhamaa wrote: > Grant Edwards : > >> I'm not an HTLM/HTTP guru, but I've tinkered with web pages for 20+ >> years, and for links within sites, I've always used links either >> relative to the current location or an absolute _path_ relative to the >> current server: >> >> W

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Rustom Mody
On Friday, January 23, 2015 at 5:18:32 PM UTC+5:30, Andrew Robinson wrote: > On 01/15/2015 09:05 AM, Ian Kelly wrote: > > On Thu, Jan 15, 2015 at 12:23 AM, Andrew Robinson wrote: > >> Can you name any other language that *does* allow subclassing of > >> booleans or creation of new boolean values? >

Re: [OT] absolute vs. relative URI

2015-01-23 Thread Marko Rauhamaa
Grant Edwards : > I'm not an HTLM/HTTP guru, but I've tinkered with web pages for 20+ > years, and for links within sites, I've always used links either > relative to the current location or an absolute _path_ relative to the > current server: > > Whatever > > I've never had any problems with li

[OT] absolute vs. relative URI

2015-01-23 Thread Grant Edwards
I'm maintaining a web app were the original author(s) went to a little bit of trouble to always use absolute URIs in links in the pages. First, the code checks the port number the server is listening on and extrapolates the protocol being used (http or https). Then it grabs the server value from

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-23 Thread Fetchinson .
On 1/23/15, Steven D'Aprano wrote: > Terry Reedy wrote: > >> On 1/22/2015 10:59 PM, Chris Angelico wrote: >>> On Fri, Jan 23, 2015 at 2:22 PM, Terry Reedy wrote: This idea is so brilliant that it is already an option in mypy and is part of the new type-hint proposal. The separate

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Mark Lawrence
On 23/01/2015 11:46, Andrew Robinson wrote: Unless I've missed something all you've done is show that you haven't got the faintest idea what you're talking about. Would you either please go away before I die laughing, or tell me where you get the stuff that you're taking. -- My fellow Py

Re: Random ALL CAPS posts on this group

2015-01-23 Thread Chris Angelico
On Fri, Jan 23, 2015 at 10:50 PM, Steven D'Aprano wrote: >> Freedom of expression entails an obligation on the state to not quash >> anyone's expression. It does not affect anyone who is not the state; it >> imposes no obligation on the PSF. > > By this reasoning, you would be perfectly comfortabl

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Chris Angelico
On Fri, Jan 23, 2015 at 10:46 PM, Andrew Robinson wrote: > 4. and he has made bool into the default return type for base type > comparison operators; which means that general programmers expect a bool for > base types and may check for it, even if Python's built in functions do not. I don't get

Re: Random ALL CAPS posts on this group

2015-01-23 Thread Steven D'Aprano
Ben Finney wrote: > Chris Angelico writes: > >> On Tue, Jan 20, 2015 at 11:38 AM, Rick Johnson >> wrote: >> > That's the beauty of free speech: "We have right to be annoyed, and >> > the author has the right not to give a damn". The only alternative >> > is fascist censorship, and I'll happily

Re: Comparisons and sorting of a numeric class....

2015-01-23 Thread Andrew Robinson
On 01/15/2015 09:05 AM, Ian Kelly wrote: On Thu, Jan 15, 2015 at 12:23 AM, Andrew Robinson wrote: Can you name any other language that *does* allow subclassing of booleans or creation of new boolean values? Yes. Several off the top of my head -- and I have mentioned these before. They general

Re: Python is DOOMED! Again!

2015-01-23 Thread Chris Angelico
On Fri, Jan 23, 2015 at 9:59 PM, Steven D'Aprano wrote: > I don't think that a raise of 0.10001 (10%), > 0.035003 (3.5%) or 0.070007 (7%) is quite what > people intended. > > :-) I also don't think it'll make any appreciable difference, especially if the actual

Re: ANN: Python Events Calendar - Please submit your 2015 events

2015-01-23 Thread M.-A. Lemburg
On 23.01.2015 11:54, Luis Miguel Morillas wrote: > Hi all > > I wrote this script that can read the Python Calendars and shows the > geolocated info on a map and on a timeline. > > http://lmorillas.github.io/python_events/ Very cool :-) Thanks. I'll add a link to our wiki page. > Enjoy > > Sa

  1   2   >