ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
Hi All, If anyone is interested, a module was born: https://bitbucket.org/nagylzs/intervalset https://pypi.python.org/pypi/intervalset/0.1.1 I have some unit tests, but testers and comments are welcome. Also see below. >> >> Hello, >> >> I need to compare sets of datetime intervals, and

Re: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
> > On Fri, Apr 1, 2016 at 1:32 AM Nagy László Zsolt > wrote: > > Does anyone know a library that already implements these functions? > > > What do you not like about the ones on PyPI? > https://pypi.python.org/pypi?%3Aaction=search&term=interval&submit=search The

how to optimize the below code with a helper function

2016-04-04 Thread Ganesh Pal
Hi Team, Iam on python 2.7.10 and Linux. I have a python function where the similar kind of pattern repeating 100 of times Sample code snippet: test01_log = os.path.join(LOG_DIR, "test01.log") cls.get_baddr['test01'] = failure.run_tool( test01_log, object="inode", offset="1

Re: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
>> element ::= (start_point_in_time, end_point_in_time) >> intervalset ::= { element1, element2, } >> >> Operations on elements: > > Eh... I think these should be realized as operations on an intervalset > with a single element, and that elements should simply have properties > like the start

2.7 source import in python 3.x

2016-04-04 Thread Robin Becker
A user points out that this code in reportlab uses the now deprecated imp module def _fake_import(fn,name): if os.path.isfile(fn): import imp with open(fn,'rb') as f: imp.load_source(name,fn,f) and suggests I use importlib SourceFileLoader. Is there anything wrong

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Peter Otten
Nagy László Zsolt wrote: > If anyone is interested, a module was born: > > https://bitbucket.org/nagylzs/intervalset > https://pypi.python.org/pypi/intervalset/0.1.1 > > I have some unit tests, but testers and comments are welcome. Why do you limit the intervals to datetime? Are there any assum

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
> Why do you limit the intervals to datetime? Are there any assumptions in > your code that would make it fail with int values? Just one. The empty interval is a singleton and I want it to be smaller than any other interval. UTC_ZERO = datetime.datetime.utcfromtimestamp(0) EMPTY_INTERVAL = Inte

Re: 2.7 source import in python 3.x

2016-04-04 Thread Peter Otten
Robin Becker wrote: > A user points out that this code in reportlab uses the now deprecated imp > module > > def _fake_import(fn,name): > if os.path.isfile(fn): > import imp > with open(fn,'rb') as f: > imp.load_source(name,fn,f) > > and suggests I use importl

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
> Why do you limit the intervals to datetime? Are there any assumptions in > your code that would make it fail with int values? It has been generalized. Now it can be used with any immutable ordered type. :-) -- https://mail.python.org/mailman/listinfo/python-list

Collection: weak error prompt drives beginner crazy

2016-04-04 Thread animalize
An example, the file-name is conflict with library-name in stdlib or installed library. There is a file uuid.py that only has two lines: import uuid print(uuid.uuid4()) Run uuid.py, output on Python 3.5.1: Traceback (most recent call last): File "D:\uuid.py", line 1, in

Re: Collection: weak error prompt drives beginner crazy

2016-04-04 Thread Joel Goldstick
On Mon, Apr 4, 2016 at 7:24 AM, animalize wrote: > An example, the file-name is conflict with library-name in stdlib or > installed library. > > There is a file uuid.py that only has two lines: > > import uuid > print(uuid.uuid4()) > > Run uuid.py, output on Python 3.5.1: > > Traceback

Re: 2.7 source import in python 3.x

2016-04-04 Thread Robin Becker
On 04/04/2016 12:15, Peter Otten wrote: .. In the example section they have (for 3.4 and above) spec = importlib.util.spec_from_file_location(module_name, file_path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) The importlib with all its factories is a

Re: Strange range

2016-04-04 Thread Mark Lawrence via Python-list
On 03/04/2016 17:28, Ethan Furman wrote: On 04/02/2016 11:58 PM, Marko Rauhamaa wrote: Stephen Hansen : I'm pretty sure that 99+% of the non-stdlib code out there is also completely inaccessible (or at least inconveniently accessible) to Stephen as well. http://nullege.com/codes/search?cq=r

Re: Sorting a list

2016-04-04 Thread Random832
On Mon, Apr 4, 2016, at 02:56, Peter Otten wrote: > > That works well. Why is it 'cheating'? > > On second thought it isn't ;) It does require a numeric type, though. There are lots of types that are orderable but do not have a negation operator that provides a key with reversed ordering. -- ht

Re: Sorting a list

2016-04-04 Thread Peter Otten
Random832 wrote: > On Mon, Apr 4, 2016, at 02:56, Peter Otten wrote: >> > That works well. Why is it 'cheating'? >> >> On second thought it isn't ;) > > It does require a numeric type, though. There are lots of types that are > orderable but do not have a negation operator that provides a key w

Re: how to optimize the below code with a helper function

2016-04-04 Thread Martin A. Brown
Greetings (again) Ganesh, I notice that you ask about how to optimize the code, but I think what you mean is you want simpler code that is less repetitive and less copy/paste error-prone. Is that correct? Below, I make a few suggestions about how to simplify, although, there probably is furt

Re: [beginner] What's wrong?

2016-04-04 Thread Mark Lawrence via Python-list
On 02/04/2016 23:49, Michael Torrie wrote: Mark, your messages are showing up to the list as being from "python," at least on my email. Any reason for this? Assuming that you're referring to me, frankly I haven't a clue. I read this list with Thunderbird on Windows, I hit "reply" to somethi

Re: how to optimize the below code with a helper function

2016-04-04 Thread Martin A. Brown
Hello again, >(1) Any tips how I can optimize this i.e test case, should have a >helper function that all test cases call. > >(2) Also note that failure.run_tool function can have variable >number of argments how to handle this in the helper function? Here's a little example of how you could

Re: Collection: weak error prompt drives beginner crazy

2016-04-04 Thread Ned Batchelder
On Monday, April 4, 2016 at 7:31:38 AM UTC-4, animalize wrote: > An example, the file-name is conflict with library-name in stdlib or > installed library. > > There is a file uuid.py that only has two lines: > > import uuid > print(uuid.uuid4()) > > Run uuid.py, output on Python 3.5.1

Re: [beginner] What's wrong?

2016-04-04 Thread BartC
On 04/04/2016 15:04, Mark Lawrence wrote: On 02/04/2016 23:49, Michael Torrie wrote: Mark, your messages are showing up to the list as being from "python," at least on my email. Any reason for this? Assuming that you're referring to me, frankly I haven't a clue. I read this list with Thunde

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Random832
On Mon, Apr 4, 2016, at 03:12, Nagy László Zsolt wrote: > > Hi All, > > If anyone is interested, a module was born: > > https://bitbucket.org/nagylzs/intervalset > https://pypi.python.org/pypi/intervalset/0.1.1 I don't know if I like it being immutable. Maybe have separate mutable and immutab

Re: Set type for datetime intervals

2016-04-04 Thread Random832
On Mon, Apr 4, 2016, at 06:15, Nagy László Zsolt wrote: > If you define the intersection operation on interval sets only, then you > need to write something like this: > > if IntervalSet(i1)*IntervalSet(i2): > pass > > which is both uglier and an overkill. I guess what I don't understand in

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Oscar Benjamin
On 4 April 2016 at 16:09, Random832 wrote: > On Mon, Apr 4, 2016, at 03:12, Nagy László Zsolt wrote: >> >> Hi All, >> >> If anyone is interested, a module was born: >> >> https://bitbucket.org/nagylzs/intervalset >> https://pypi.python.org/pypi/intervalset/0.1.1 > > I don't know if I like it bei

module alias in import statement

2016-04-04 Thread ast
hello import tkinter as tk import tk.ttk as ttk Traceback (most recent call last): File "", line 1, in import tk.ttk as ttk ImportError: No module named 'tk' of course import tkinter.ttk as ttk works Strange, isn't it ? -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Random832
On Mon, Apr 4, 2016, at 11:32, Oscar Benjamin wrote: > On 4 April 2016 at 16:09, Random832 wrote: > > Like I said before, I don't think the set-like operations on Intervals > > are useful - what can you accomplish with them rather than by making a > > set consisting of only one interval and doing

Re: Set type for datetime intervals

2016-04-04 Thread Martin A. Brown
Greetings László, >I need to compare sets of datetime intervals, and make set >operations on them: intersect, union, difference etc. One element >of a set would be an interval like this: > >element ::= (start_point_in_time, end_point_in_time) >intervalset ::= { element1, element2, } > >Ope

Re: module alias in import statement

2016-04-04 Thread Ned Batchelder
On Monday, April 4, 2016 at 11:31:41 AM UTC-4, ast wrote: > hello > > >>> import tkinter as tk > >>> import tk.ttk as ttk > > Traceback (most recent call last): > File "", line 1, in > import tk.ttk as ttk > ImportError: No module named 'tk' > > > of course > > >>> import tkinter.ttk as

troubleshooting

2016-04-04 Thread Sk. Amirul Islam
i recently installed the application but when i ran it it gave a 'runtime error". i even reinstalled it. but it gives the same error everytime i try. im eclosing a screenshot of the error . thank you -- https://mail.python.org/mailman/listinfo/python-list

Re: troubleshooting

2016-04-04 Thread Igor Korot
Hi, On Mon, Apr 4, 2016 at 12:03 PM, Sk. Amirul Islam wrote: > i recently installed the application but when i ran it it gave a 'runtime > error". i even reinstalled it. but it gives the same error everytime i try. > im eclosing a screenshot of the error . thank you Attachments are not going thr

Re: module alias in import statement

2016-04-04 Thread Steven D'Aprano
On Tue, 5 Apr 2016 01:31 am, ast wrote: > hello > import tkinter as tk import tk.ttk as ttk > > Traceback (most recent call last): > File "", line 1, in > import tk.ttk as ttk > ImportError: No module named 'tk' > > > of course > import tkinter.ttk as ttk > > works > >

Re: troubleshooting

2016-04-04 Thread Steven D'Aprano
On Tue, 5 Apr 2016 02:03 am, Sk. Amirul Islam wrote: > i recently installed the application but when i ran it it gave a 'runtime > error". i even reinstalled it. but it gives the same error everytime i > try. im eclosing a screenshot of the error . thank you Hi. Which application are you talking

Best Practices for Internal Package Structure

2016-04-04 Thread Josh B.
My package, available at https://github.com/jab/bidict, is currently laid out like this: bidict/ ├── __init__.py ├── _bidict.py ├── _common.py ├── _frozen.py ├── _loose.py ├── _named.py ├── _ordered.py ├── compat.py ├── util.py I'd like to get some more feedback on a question about this layout

Re: Best Practices for Internal Package Structure

2016-04-04 Thread Sven R. Kunze
Hi Josh, good question. On 04.04.2016 18:47, Josh B. wrote: My package, available at https://github.com/jab/bidict, is currently laid out like this: bidict/ ├── __init__.py ├── _bidict.py ├── _common.py ├── _frozen.py ├── _loose.py ├── _named.py ├── _ordered.py ├── compat.py ├── util.py I'd

Twisted 16.1 Release Announcement

2016-04-04 Thread Amber "Hawkie" Brown
On behalf of Twisted Matrix Laboratories, I am honoured to announce the release of Twisted 16.1! This release is hot off the heels of 16.0 released last month, including some nice little tidbits. The highlights include: - twisted.application.internet.ClientService, a service that maintains a p

Python programs and relative imports

2016-04-04 Thread Rob Gaddi
Does anyone know the history of why relative imports are only available for packages and not for "programs"? It certainly complicates life. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.o

Re: Best Practices for Internal Package Structure

2016-04-04 Thread Michael Selik
On Mon, Apr 4, 2016 at 6:04 PM Sven R. Kunze wrote: > Hi Josh, > > good question. > > On 04.04.2016 18:47, Josh B. wrote: > > My package, available at https://github.com/jab/bidict, is currently > laid out like this: > > > > bidict/ > > ├── __init__.py > > ├── _bidict.py > > ├── _common.py > > ├─

Request Help With Function

2016-04-04 Thread Wildman via Python-list
I am working on a Linux gui program where I want to be able to click a Help button and open a man page using a viewer. I wrote a search function that can be called several times, if needed, with different arguments. I wrote a test program that tries to open the Bash man page in a terminal and will

Re: Request Help With Function

2016-04-04 Thread Ian Kelly
On Mon, Apr 4, 2016 at 1:42 PM, Wildman via Python-list wrote: > commandlist = commandlist.split(",") commandlist is a list. > command = [target, commandlist] > subprocess.Popen(command) This is passing a list containing two elements: the first is a string, a

How can I install

2016-04-04 Thread Mohamed Ali via Python-list
I have tried to install python and nltk but I couldn't. Please could you please help me because I need to work on natural language processing using Python. Regards,Mohamed -- https://mail.python.org/mailman/listinfo/python-list

Re: Request Help With Function

2016-04-04 Thread MRAB
On 2016-04-04 20:42, Wildman via Python-list wrote: I am working on a Linux gui program where I want to be able to click a Help button and open a man page using a viewer. I wrote a search function that can be called several times, if needed, with different arguments. I wrote a test program that

Re: How can I install

2016-04-04 Thread MRAB
On 2016-04-04 20:51, Mohamed Ali via Python-list wrote: I have tried to install python and nltk but I couldn't. Please could you please help me because I need to work on natural language processing using Python. You haven't given any details. -- https://mail.python.org/mailman/listinfo/pytho

Re: Best Practices for Internal Package Structure

2016-04-04 Thread Mark Lawrence via Python-list
On 04/04/2016 19:45, Michael Selik wrote: On Mon, Apr 4, 2016 at 6:04 PM Sven R. Kunze wrote: Hi Josh, good question. On 04.04.2016 18:47, Josh B. wrote: My package, available at https://github.com/jab/bidict, is currently laid out like this: bidict/ ├── __init__.py ├── _bidict.py ├── _c

IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.

2016-04-04 Thread Steven Gao
I’m getting “IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.”. Any ideas? Sent from Mail for Windows 10 --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -- https://m

Re: module alias in import statement

2016-04-04 Thread Terry Reedy
On 4/4/2016 11:31 AM, ast wrote: hello import tkinter as tk import tk.ttk as ttk Traceback (most recent call last): File "", line 1, in import tk.ttk as ttk ImportError: No module named 'tk' of course import tkinter.ttk as ttk works Strange, isn't it ? Nope. As other said, 'im

Re: IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.

2016-04-04 Thread Mark Lawrence via Python-list
On 04/04/2016 21:19, Steven Gao wrote: I’m getting “IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.”. Any ideas? Sent from Mail for Windows 10 Asked and answered repeatedly, please search the archives for the answer. --

Re: [Beginner] - Hanging in the code, can't figure out what's wrong

2016-04-04 Thread Ben Finney
"Loop.IO" writes: > You now seem to be on some sort of rampage You've mis-interpreted Erik's attempts to help. Somehow the requests for details have made you defensive; I'm not sure why. Erik certainly was not being hostile to you. Hopefully you can take a more dispassionate position when you a

Re: IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.

2016-04-04 Thread Terry Reedy
On 4/4/2016 4:19 PM, Steven Gao wrote: I’m getting “IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.”. Any ideas? Depending on how you started, another possibility is a file in your local directory that masks a stdlib modu

Re: Plot/Graph

2016-04-04 Thread Muhammad Ali
On Sunday, April 3, 2016 at 5:19:15 PM UTC-7, MRAB wrote: > On 2016-04-04 01:04, Muhammad Ali wrote: > > On Sunday, April 3, 2016 at 2:35:58 PM UTC-7, Oscar Benjamin wrote: > >> On 3 Apr 2016 22:21, "Muhammad Ali" wrote: > >> > > >> > How do I convert/change/modify python script so that my data c

From email addresses sometimes strange on this list - was Re: [beginner] What's wrong?

2016-04-04 Thread Michael Torrie
On 04/04/2016 08:04 AM, Mark Lawrence via Python-list wrote: > On 02/04/2016 23:49, Michael Torrie wrote: >> Mark, your messages are showing up to the list as being from "python," >> at least on my email. Any reason for this? >> > > Assuming that you're referring to me, frankly I haven't a clue.

Re: From email addresses sometimes strange on this list - was Re: [beginner] What's wrong?

2016-04-04 Thread Chris Angelico
On Tue, Apr 5, 2016 at 8:55 AM, Michael Torrie wrote: > Usenet-orginating posts look fine. For example: > > From: Marko Rauhamaa > Newsgroups: comp.lang.python > > Whereas email ones are sometimes looking like this: > > From: Mark Lawrence via Python-list > Reply-To: Mark Lawrence O T

Re: From email addresses sometimes strange on this list - was Re: [beginner] What's wrong?

2016-04-04 Thread Michael Torrie
On 04/04/2016 04:58 PM, Chris Angelico wrote: > O That probably explains it. It's because of Yahoo and mailing > lists. Yahoo did stuff that breaks stuff, so Mailman breaks stuff > differently to make sure that only Yahoo people get messed up a bit. > It means their names and addresses get

testing python program,project and django site

2016-04-04 Thread Xristos Xristoou
hello, i am python user and i have some projects,programs and sites with django in python. i want one more step deeper,i want to test my programs for bugs,weaknesses,vulnerability,security or penetration test,on my sites for crashes(because use python apps).because the user i am now on the featur

Re: Plot/Graph

2016-04-04 Thread MRAB
On 2016-04-04 23:35, Muhammad Ali wrote: On Sunday, April 3, 2016 at 5:19:15 PM UTC-7, MRAB wrote: On 2016-04-04 01:04, Muhammad Ali wrote: > On Sunday, April 3, 2016 at 2:35:58 PM UTC-7, Oscar Benjamin wrote: >> On 3 Apr 2016 22:21, "Muhammad Ali" wrote: >> > >> > How do I convert/change/modi

Re: Plot/Graph

2016-04-04 Thread Muhammad Ali
On Sunday, April 3, 2016 at 2:35:58 PM UTC-7, Oscar Benjamin wrote: > On 3 Apr 2016 22:21, "Muhammad Ali" wrote: > > > > How do I convert/change/modify python script so that my data could be > extracted according to python script and at the end it generates another > single extracted data file in

Re: Request Help With Function

2016-04-04 Thread Wildman via Python-list
On Mon, 04 Apr 2016 13:54:56 -0600, Ian Kelly wrote: > On Mon, Apr 4, 2016 at 1:42 PM, Wildman via Python-list > wrote: >> commandlist = commandlist.split(",") > > commandlist is a list. > >> command = [target, commandlist] >> subprocess.Popen(command) > > T

Re: Request Help With Function

2016-04-04 Thread Wildman via Python-list
On Mon, 04 Apr 2016 21:02:53 +0100, MRAB wrote: > On 2016-04-04 20:42, Wildman via Python-list wrote: >> launch_help() >> > .Popen will accept either a string or a list of strings. > > You're giving it a list that contains a string and a list. Yep, that was my foolish mistake. Thanks. > BTW

Re: Plot/Graph

2016-04-04 Thread Muhammad Ali
On Tuesday, April 5, 2016 at 8:16:22 AM UTC+8, Muhammad Ali wrote: > On Sunday, April 3, 2016 at 2:35:58 PM UTC-7, Oscar Benjamin wrote: > > On 3 Apr 2016 22:21, "Muhammad Ali" wrote: > > > > > > How do I convert/change/modify python script so that my data could be > > extracted according to pyth

Re: Best Practices for Internal Package Structure

2016-04-04 Thread Steven D'Aprano
On Tue, 5 Apr 2016 02:47 am, Josh B. wrote: > My package, available at https://github.com/jab/bidict, is currently laid > out like this: > > bidict/ > ├── __init__.py > ├── _bidict.py > ├── _common.py > ├── _frozen.py > ├── _loose.py > ├── _named.py > ├── _ordered.py > ├── compat.py > ├── util.py

Re: Plot/Graph

2016-04-04 Thread Steven D'Aprano
On Tue, 5 Apr 2016 08:33 am, Muhammad Ali wrote: [couple of hundred lines of quoted text] [followed by about a thousand lines of code] Seriously? Do you really expect people to read through hundreds of lines of quotes, going at least three levels > > > deep, and then read a thousand lines of cod

Re: How can I install

2016-04-04 Thread Steven D'Aprano
On Tue, 5 Apr 2016 05:51 am, Mohamed Ali wrote: > > I have tried to install python and nltk but I couldn't. Please could you > please help me because I need to work on natural language processing using > Python. There are about ten thousand different things that could be going wrong, "I couldn't

Launcher for 64 bits doesnt work

2016-04-04 Thread Gustaf Nilsson
Hi! The only 3.5.1 versio that works for me is the 32 bits version, will it be a problem to use the 32 bits version for 64 bits computer? -- https://mail.python.org/mailman/listinfo/python-list

Trouble trying to install Python 3.5.1 (32-bit) for windows

2016-04-04 Thread Yuri Armellei
Dear Python, I encountered difficulties when installing the python. Could you guys help me to solve and install it?! Attached log error to help you guys to help me out. =) ;) Regards, [cid:image001.png@01D18EA7.4A69B7E0] [cid:image006.jpg@01D152DC.ACCAF540] Yuri Armellei Tesouraria T

Re: Launcher for 64 bits doesnt work

2016-04-04 Thread Zachary Ware
Hi Gustaf, On Mon, Apr 4, 2016 at 9:38 PM, Gustaf Nilsson wrote: > Hi! > > The only 3.5.1 versio that works for me is the 32 bits version, will it be > a problem to use the 32 bits version for 64 bits computer? >From your mention of a 'launcher' I'm assuming you're on Windows. It's perfectly fin

Re: module alias in import statement

2016-04-04 Thread Rustom Mody
On Tuesday, April 5, 2016 at 2:17:24 AM UTC+5:30, Terry Reedy wrote: > On 4/4/2016 11:31 AM, ast wrote: > > hello > > > import tkinter as tk > import tk.ttk as ttk > > > > Traceback (most recent call last): > > File "", line 1, in > > import tk.ttk as ttk > > ImportError: No module

Re: Launcher for 64 bits doesnt work

2016-04-04 Thread Gustaf
Thsnk you for your response, the pip installer doesnt work, only for the launcher for 32 bits. But my mainproblem is that I cant connect pygresql. I can download the package but after it says that it cant find the module Enviado desde mi iPhone > El 4 apr 2016, a las 22:39, Zachary Ware > e

Re: Launcher for 64 bits doesnt work

2016-04-04 Thread Ben Finney
Gustaf writes: > Enviado desde mi iPhone Perhaps you could wait until you're at a better computer for corresponding, and compose messages with more information to work out what's happening. -- \ “Contentment is a pearl of great price, and whosoever procures | `\it at the expens

Re: Trouble trying to install Python 3.5.1 (32-bit) for windows

2016-04-04 Thread Rustom Mody
On Tuesday, April 5, 2016 at 8:19:44 AM UTC+5:30, Yuri Armellei wrote: > Dear Python, > > I encountered difficulties when installing the python. > > Could you guys help me to solve and install it?! > > Attached log error to help you guys to help me out. =) ;) > > Regards, > > > > [cid:i

Re: module alias in import statement

2016-04-04 Thread Chris Angelico
On Tue, Apr 5, 2016 at 2:08 PM, Rustom Mody wrote: >> 'import tk.ttk' looks for 'tk' in sys.modules, does not find it, looks >> for a module named 'tk' on disk, does not find it, and says so. > > A well-known quote comes to mind: > > | There are only two hard things in Computer Science: cache inva

Re: module alias in import statement

2016-04-04 Thread Rustom Mody
On Tuesday, April 5, 2016 at 9:53:30 AM UTC+5:30, Chris Angelico wrote: > On Tue, Apr 5, 2016 at 2:08 PM, Rustom Mody wrote: > >> 'import tk.ttk' looks for 'tk' in sys.modules, does not find it, looks > >> for a module named 'tk' on disk, does not find it, and says so. > > > > A well-known quote c

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
> I don't know if I like it being immutable. Maybe have separate mutable > and immutable versions. The reason for making it immutable is implementation specific. These intervals are stored in an ordered list. Overlapping intervals are unified by the constructor. This makes sure that sets with equa