Re: argparse — adding a --version flag in the face of positional args

2022-11-27 Thread Matt Wheeler
g to process --verbose, then > exit? > > Thx, > > Skip > -- > https://mail.python.org/mailman/listinfo/python-list -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Not found in the documentation

2021-04-29 Thread Matt Wheeler
, 6, 7, 8, 9] ``` range objects are iterables, not iterators. We can see the consuming behaviour I think you are referring to by calling iter(): ``` >>> i = iter(r) >>> next(i) 0 >>> list(i) [1, 2, 3, 4, 5, 6, 7, 8, 9] ``` -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Code Formatter Questions

2021-03-29 Thread Matt Wheeler
> On 29 Mar 2021, at 04:45, Cameron Simpson wrote: > > yapf has many tunings. Worth a look. It is my preferred formatter. By > comparison, black is both opinionated and has basicly no tuning, > something I greatly dislike. This is not a mark or a vote against yapf (I’ve never used it), but

Re: Is there any way to check/de-cruft/update Python packages installed using pip?

2020-12-29 Thread Matt Wheeler
On 29 Dec 2020, 14:48 +, Chris Green , wrote: > I seem to have quite a lot of old python packages installed over the > years using pip and would like, if I can. to clear some of them out. > > > Is there any way to tell if a python package was installed by me > directly using pip or was

Re: list of dictionaries search using kwargs

2020-12-07 Thread Matt Wheeler
for item in self.data:     if all(item[k] == v for k,v in kwargs.items()):         return item Or return [item for item in self.data if all(item[k] == v for k,v in kwargs.items())] to return all matches Beware though that either of these will be slow if your list of dicts is large. If the

Re: How to remove "" from starting of a string if provided by the user

2020-08-12 Thread Matt Wheeler
On Tue, 11 Aug 2020, 02:20 Ganesh Pal, wrote: > The possible value of stat['server2'] can be either (a) > "'/fileno_100.txt'" or (b) '/fileno_100.txt' . > > How do I check if it the value was (a) i.e string started and ended > with a quote , so that I can use ast.literal_eval() > BAFP > def

Re: How to turn a defaultdict into a normal dict.

2020-06-16 Thread Matt Wheeler
t; >>> from collections import defaultdict > >>> d = defaultdict(list) > >>> d["x"] > [] > >>> d.default_factory = None > >>> d["y"] > Traceback (most recent call last): > File "", line 1, in > KeyE

Re: issue with regular expressions

2019-10-22 Thread Matt Wheeler
On Tue, 22 Oct 2019, 09:44 joseph pareti, wrote: > the following code ends in an exception: > > import re > pattern = 'Sottoscrizione unica soluzione' > mylines = []# Declare an empty list. with open ('tmp.txt', 'rt') as myfile: # Open tmp.txt for reading

Re: Generators, generator expressions, and loops

2018-11-16 Thread Matt Wheeler
> On 16 Nov 2018, at 14:54, Steve Keller wrote: > More elegant are generator expressions but I cannot think of a way > without giving an upper limit: > >for i in (2 ** i for i in range(100)): >... > > which looks ugly. Also, the double for-loop (and also the two loops > in

Re: All of a sudden code started throwing errors

2018-11-14 Thread Matt Wheeler
manager def pushd(path): old_dir = os.getcwd() os.chdir(path) try: yield finally: os.chdir(old_dir) ``` (I tend to just copy this into projects where I need it (or write it again), as a whole dependency for something so tiny seems like it would be overkill :

Re: psutil

2018-02-27 Thread Matt Wheeler
7/psutil/_psutil_common.o > Based on the include path you have here this looks like you have a non standard python package for EL7 (in addition to the system one, or you'd be having a worse day), which is probably the root of your problem. Are you using python packages from scl perhaps? If so y

Re: [OT] Dutch Reach [was Re: Where has the practice of sending screen shots as source code come from?]

2018-01-30 Thread Matt Wheeler
ly helpful advice if you're sitting in any seat other than the driver's seat, however. -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: unabe to import /pyd file.

2017-12-25 Thread Matt Wheeler
ry [ https://github.com/robotframework/RemoteInterface] to run the Java-dependent parts in Jython & the CPython-dependent parts in CPython (I've not used the remote library myself so don't know how easy it is to work with, but it should work either way around)) * pip install robotframework > -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Recommended pypi caching proxy?

2017-12-18 Thread Matt Wheeler
it does that well and it appears to still be pretty active. > -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-29 Thread Matt Wheeler
ty of any other cross-platform incompatibilities playing a part? > -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: import issues python3.4

2017-11-10 Thread Matt Wheeler
call` it will be available in the local $PATH [0] https://tox.readthedocs.io/en/latest/ [1] http://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
I guess you still didn't run it ;D (see the 2nd `for` statement). I diffed my output against the original, which is why I'm confident in the correctness of my solution ;) Actually I managed to shave off another byte by changing `l.insert(i,'')` to `l[i:i]=['']`, so now I'm on 259. I should probably st

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
you didn't try it? (or see `upper()` in the body of the `for` below) > l=[" Boolean Operators\n"+"-"*24] > > for x in [(l,p,r)for p in(a,o)for l in(t,f)for r > in(t,f)]+[(n,t),(n,f)]:x=' > > '.join(x);l+=[x[0].upper()+x[1:]+" is "+str(eval(x))] > &

Re: Printing a Chunk Of Words

2017-09-27 Thread Matt Wheeler
for x in [(l,p,r)for p in(a,o)for l in(t,f)for r in(t,f)]+[(n,t),(n,f)]:x=' '.join(x);l+=[x[0].upper()+x[1:]+" is "+str(eval(x))] for i in 12,9,5,0:l.insert(i,'') print('\n'.join(l)) -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Send mouse clicks to minimized window

2017-08-28 Thread Matt Wheeler
ger level automation tool (and will also solve the focus problem for you). [0] https://github.com/pywinauto/pywinauto -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposed new syntax

2017-08-10 Thread Matt Wheeler
f x < 5 for y in (100, 200)] [100, 200, 101, 201, 102, 202, 103, 203, 104, 204] -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Subclassing dict to modify values

2017-08-02 Thread Matt Wheeler
collections.abc.html#collections-abstract-base-classes All of the mixin methods (the ones defined for you) will call the abstract methods you override. -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: @lru_cache on functions with no arguments

2017-08-01 Thread Matt Wheeler
On Tue, 1 Aug 2017 at 12:53 Thomas Nyberg <tomuxi...@gmx.com> wrote: > On 08/01/2017 01:06 PM, Matt Wheeler wrote: > > A function which is moderately expensive to run, that will always return > > the same result if run again in the same process, and which will not be > &

Re: @lru_cache on functions with no arguments

2017-08-01 Thread Matt Wheeler
nment during a single run, maintaining the interface would trump simplicity for the simple case). I've not investigated the Django codebase, so I don't know if my guesses line up with it exactly, but it should be quite easy to construct a grep or sed script to scan the source to find out :) -- --

Re: is @ operator popular now?

2017-07-15 Thread Matt Wheeler
on.org/dev/peps/pep-0465/ Perhaps it should also be listed at https://docs.python.org/3.6/genindex-Symbols.html -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: is @ operator popular now?

2017-07-15 Thread Matt Wheeler
module level would be more appropriate) > -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Google Sheets API Error

2017-06-17 Thread Matt Wheeler
ntention has been mangled somewhere along the way, and in any case the code seems to be missing parts. -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: API Help

2017-06-14 Thread Matt Wheeler
uantityAvailable":0.0}]}] >>> json.loads(s) [{u'inventory': [{u'quantityAvailable': 0.0, u'warehouseCode': u'UT1-US'}, {u'quantityAvailable': 0.0, u'warehouseCode': u'KY1US'}, {u'quantityAvailable': 14.0, u'warehouseCode': u'TX-1-US'}, {u'quantityAvailable': 4.0, u'warehouseCode': u'CA-1-US'}, {u'quantityAvailable': 1.0, u'warehouseCode': u'AB-1-CA'}, {u'quantityAvailable': 0.0, u'warehouseCode': u'WA-1-US'}, {u'quantityAvailable': 0.0, u'warehouseCode': u'PO-1-CA'}], u'itemNumber': u'75-5044'}] Looks like json to me, and to json.loads, which is probably more authoritative :) -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Finding the name of an object's source file

2017-06-06 Thread Matt Wheeler
hout using inspect, we can get around `Object.__module__` being a string by importing it as a string: >>> import importlib, os >>> importlib.import_module(os.path.split.__module__).__file__ '/Users/matt/.pyenv/versions/3.6.0/lib/python3.6/posixpath.py' -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Logging function calls without changing code

2017-05-24 Thread Matt Wheeler
og the arguments passed to the functions (you didn't say that) things get a bit more complex, but it's still certainly achievable. If you actually need to wrap the class in place for testing you might look into combining something like the above with the mock library. -- -- Matt Wheeler http://

Re: Substitute a mock object for the metaclass of a class

2017-03-13 Thread Matt Wheeler
A small correction... On Mon, 13 Mar 2017 at 22:36 Matt Wheeler <m...@funkyhat.org> wrote: > ``` > from unittest.mock import patch > > import lorem > > > @patch('lorem.type') > def test_things(mocktype): > lorem.quux(metameta.Foo()) > > lorem.return

Re: Substitute a mock object for the metaclass of a class

2017-03-13 Thread Matt Wheeler
'Foo', unittest.mock.ANY, unittest.mock.ANY) > When I try to add the stub_metaclass side_effect in to my code I get `TypeError: __new__() missing 2 required positional arguments: 'bases' and 'namespace'` ... which seems quite reasonable, and I expect you're in a better position to figur

Re: Screwing Up looping in Generator

2017-01-05 Thread Matt Wheeler
On Tue, 3 Jan 2017 at 21:46 Matt Wheeler <m...@funkyhat.org> wrote: > range() is not part of the for syntax at all, it's completely separate, it > simply returns an iterator which the for loop can use, like any other. > *iterable -- -- Matt Wheeler http://funkyh.at -- https://

Re: Screwing Up looping in Generator

2017-01-05 Thread Matt Wheeler
nge() is not part of the for syntax at all, it's completely separate, it simply returns an iterator which the for loop can use, like any other. -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Screwing Up looping in Generator

2017-01-03 Thread Matt Wheeler
On Tue, 3 Jan 2017 at 21:46 Matt Wheeler <m...@funkyhat.org> wrote: > range() is not part of the for syntax at all, it's completely separate, it > simply returns an iterator which the for loop can use, like any other. > *iterable -- -- Matt Wheeler http://funkyh.at -- https://

Re: Screwing Up looping in Generator

2017-01-03 Thread Matt Wheeler
t part of the for syntax at all, it's completely separate, it simply returns an iterator which the for loop can use, like any other. -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Choosing a Python IDE. what is your Pythonish recommendation? I do not know what to choose.

2017-01-02 Thread Matt Wheeler
ur computer is fast enough (it's a bit of a resource hog), and syntastic as a great way to integrate style checkers & linters into vim. -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: just started

2016-12-19 Thread Matt Wheeler
d. I have only pip3.5 and the command python3.5 -m pip > install automatically translates into pip3.5 ? > Actually it's the other way around. The `pip3.5` (and `pip3`) commands both map to (effectively) `python3.5 -m pip`. You can see this if you run `cat $(which pip3)`. -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: OT - "Soft" ESC key on the new MacBook Pro

2016-12-16 Thread Matt Wheeler
lems? So... Not for me, but obviously with the caveats above. Giving it a try in an Apple store is definitely a good idea :) -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: correct way to catch exception with Python 'with' statement

2016-11-29 Thread Matt Wheeler
On Tue, 29 Nov 2016 at 23:59 wrote: > If you want to do something only if the file exists (or does not), use > os.path.isfile(filename) > This opens you up to a potential race condition (and has potential security implications, depending on the application), as you're using

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Matt Wheeler
quivalent. Consider `a, b, c = 1, 7, 4` > Using consistent operators is not required but is easier to read and less > confusing. > Unfortunately in this case it's also less correct > -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Can this be easily done in Python?

2016-09-28 Thread Matt Wheeler
On Tue, 27 Sep 2016 at 20:58 TUA wrote: > Is the following possible in Python? > > Given how the line below works > > TransactionTerms = 'TransactionTerms' > > > have something like > > TransactionTerms = > > that sets the variable TransactionTerms to its own name as

Re: how to automate java application in window using python

2016-09-20 Thread Matt Wheeler
On Tue, 20 Sep 2016, 02:47 meInvent bbird, wrote: > can it contorl Maplesoft's maple which is a java executable file? > I don't know maple so I can't answer that. Which programming language an application is written in isn't really relevant for pywinauto, it's the

Re: how to automate java application in window using python

2016-09-18 Thread Matt Wheeler
On Thu, 15 Sep 2016, 08:12 meInvent bbird, wrote: > how to automate java application in window using python > > 1. scroll up or down of scroll bar > 2. click button > 3. type text in textbox > I would recommend having a look at pywinauto

Re: PSA: Debian Stretch, apt-listchanges, and Python 3

2016-08-29 Thread Matt Wheeler
I think the real PSA is "don't mess with the system python(3) version". On Mon, 29 Aug 2016 at 13:18 Chris Angelico wrote: > If, like me, you build Python 3.6 from source and make it your default > 'python3' binary, you may run into issues with the latest > apt-listchanges,

Re: Win32 API in pywin32

2016-08-05 Thread Matt Wheeler
On Fri, 5 Aug 2016, 02:23 Lawrence D’Oliveiro, wrote: > On Friday, August 5, 2016 at 12:06:23 PM UTC+12, Igor Korot wrote: > > > > On Thu, Aug 4, 2016 at 4:57 PM, Lawrence D’Oliveiro wrote: > >> On Friday, August 5, 2016 at 11:50:28 AM UTC+12, jj0ge...@gmail.com > wrote:

Re: functools.partial [was Re: and on - topic and and off topic]

2016-07-29 Thread Matt Wheeler
On Fri, 29 Jul 2016, 09:20 Steven D'Aprano, wrote: > I'm not sure that partial is intended as an optimization. It may end up > saving time by avoiding evaluating arguments, but that's not why it exists. > It exists to enable the functional programming idiom of partial

Re: Running yum/apt-get from a virtualenv

2016-07-04 Thread Matt Wheeler
On Fri, 24 Jun 2016, 03:32 Tiglath Suriol, wrote: > Let us say that I install PostgreSQL from an activated virtualenv using > yum or apt-get, will PostgrSQL be local or global? > Global I understand that virtualenv isolates the Python environment only, so I > surmise

Re: Re - Contradictory error messages in Python 3.4 - standard library issue!

2016-06-16 Thread Matt Wheeler
On Thu, 16 Jun 2016, 23:31 Harrison Chudleigh, < harrison.chudlei...@education.nsw.gov.au> wrote: > Sorry! I was trying to indent a line and accidentally sent only half of the > message. > It would be helpful if your reply was actually a reply to your previous message, to enable us to follow the

Re: i'm a python newbie & wrote my first script, can someone critique it?

2016-06-10 Thread Matt Wheeler
First of all welcome :) The other suggestions you've received so far are good so I won't repeat them... (note that in particular I've reused the names you've chosen in your program where I've given code examples, but that's purely for clarity and I agree with the others who've said you should use

Re: I'm wrong or Will we fix the ducks limp?

2016-06-03 Thread Matt Wheeler
Hi, On Fri, 3 Jun 2016, 16:04 Sayth Renshaw, wrote: > > So at the point I create the variable it refers to an object. > It's best to think of them as names, rather than variables, as names in python don't behave quite how you'll expect variables to if you're coming from

Re: Don't understand a probleme of module time not defined when calling a foo func

2016-05-30 Thread Matt Wheeler
On Mon, 30 May 2016, 21:08 Ni Va, wrote: > > _ > Output: > Traceback (most recent call last): > File "", line 1, in > File "", line 16, in PyExecReplace > File "", line 22, in > File "", line 11, in foo > NameError: global name 'time' is not defined >

Re: re.search - Pattern matching review

2016-05-30 Thread Matt Wheeler
e. Attempting to protect against other possibilities will at best provide no benefit, and is likely to make your job harder when you're debugging later on. Another thing to note for future reference is if you want to use a try:except block to inject logging you can re-raise the original except

Re: re.search - Pattern matching review

2016-05-29 Thread Matt Wheeler
g.info("block not found") >return False > logging.info("block not found") > return block And you probably don't need to explicitly return false, python functions implicitly return None (which is falsey) if they don't reach a return statement, but that's perhaps a matter of taste. -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Question on List processing

2016-04-25 Thread Matt Wheeler
On Mon, 25 Apr 2016 15:56 , wrote: > Dear Group, > > I have a list of tuples, as follows, > > list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA > philanthropic/NA activities/NA ','class1')", u"('koteeswaram/BHPERSN is/NA > a/NA very/NA nice/NA

Re: How much sanity checking is required for function inputs?

2016-04-23 Thread Matt Wheeler
('or something') class Queen(Piece): def validate_move(self, new): return any((test(self.position, new) for test in (move_straight, move_diag))) Ok I'll stop before I get too carried away... This is completely untested so bugs will abound I'm sure :) -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: sum accuracy

2016-04-15 Thread Matt Wheeler
pect > > exact_sum([0.3, 0.7]) > > to be 1. and make def not_exact_but_probably_the_sum_you_wanted(nums): return sum(map(lambda x:Fraction(x).limit_denominator(), nums)) -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-24 Thread Matt Wheeler
esn't clear the list, that results in a list of the same length where every element is 0. That might sound like the same thing if you're used to a bounded array of ints, for example, but in Python it's very much not. -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2016-03-24 Thread Matt Wheeler
On Thu, 24 Mar 2016 11:10 Sven R. Kunze, <srku...@mail.de> wrote: > On 24.03.2016 11:57, Matt Wheeler wrote: > >>>> import ast > >>>> s = "(1, 2, 3, 4)" > >>>> t = ast.literal_eval(s) > >>>> t > > (1, 2, 3

Re: newbie question

2016-03-24 Thread Matt Wheeler
quot; > > and I want to recover the tuple in a variable t > > t = (1, 2, 3, 4) > > how would you do ? > > > -- > https://mail.python.org/mailman/listinfo/python-list -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: monkey patching __code__

2016-03-21 Thread Matt Wheeler
On 20 March 2016 at 16:46, Sven R. Kunze <srku...@mail.de> wrote: > On 19.03.2016 00:58, Matt Wheeler wrote: >> >> I know you have a working solution now with updating the code & >> defaults of the function, but what about just injecting your function >> into

Re: monkey patching __code__

2016-03-19 Thread Matt Wheeler
None, prefix=None, > current_app=None): > > > Some ideas? I know you have a working solution now with updating the code & defaults of the function, but what about just injecting your function into the modules that had already imported it after the monkeypatching? Seems perhaps cleaner, u

Re: Review Request of Python Code

2016-03-10 Thread Matt Wheeler
ictionary("NewTotalTag.txt") You also aren't closing the file that you open at any point -- once you've loaded the data from it there's no need to keep the file opened (look up context managers). -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Review Request of Python Code

2016-03-09 Thread Matt Wheeler
On 9 March 2016 at 12:06, Matt Wheeler <m...@funkyhat.org> wrote: > But we can still do better. A list is a poor choice for this kind of > lookup, as Python has no way to find elements other than by checking > them one after another. (given (one of the) name(s) you've given it >

Re: Review Request of Python Code

2016-03-09 Thread Matt Wheeler
h you should definitely still do that too!), especially if your word list is very large. This is because the set type uses a hashmap internally, making lookups for matches extremely fast, compared to scanning through the list. -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: urlopen, six, and py2

2016-03-02 Thread Matt Wheeler
ile than using a context manager to clean up for you, I expect you won't bother :). [1] https://docs.python.org/2/library/contextlib.html#contextlib.closing -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-19 Thread Matt Wheeler
ad about returning the best fit type (i.e. int, if not then float, if not then str)? -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Guido on python3 for beginners

2016-02-18 Thread Matt Wheeler
On Thu, 18 Feb 2016 11:07 Chris Angelico wrote: > By the way... For bash users, adding this to .bashrc may make venvs a > bit easier to keep straight: > > checkdir() { > [ -n "$VIRTUAL_ENV" ] && ! [[ `pwd` =~ `dirname $VIRTUAL_ENV`* ]] > && echo Deactivating venv

Re: Make a unique filesystem path, without creating the file

2016-02-14 Thread Matt Wheeler
same dir then perhaps use tempfile.NamedTemporaryFile with your newly created temp dir and an arbitrary suffix, and strip the suffix off to get the name you actually use.) -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: modifying a standard module? (was: Re: tarfile : read from a socket?)

2016-02-12 Thread Matt Wheeler
you must patch the standard library tarfile module then I would suggest patching it to have an extra, default False, argument to enable your printing behaviour, so you don't risk messing up anyone else's use of it. -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Storing a big amount of path names

2016-02-12 Thread Matt Wheeler
sorry about that, I think our aim was a little off with a few of the brandings. -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Set Operations on Dicts

2016-02-08 Thread Matt Wheeler
On 8 February 2016 at 12:17, Jussi Piitulainen <jussi.piitulai...@helsinki.fi> wrote: > Also, what would be the nicest current way to express a priority union > of dicts? > > { k:(d if k in d else e)[k] for k in d.keys() | e.keys() } Since Python 3.5: {**e, **d} --

Re: python-2.7.3 vs python-3.2.3

2016-01-26 Thread Matt Wheeler
est to just try out your script and find out though. -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: How to simulate C style integer division?

2016-01-21 Thread Matt Wheeler
//b) ... >>> num = 3**171 >>> num 3870210234510307998744588107535211184800325224934979257430349324033792477926791547 >>> num2 = 4**80 >>> num2 1461501637330902918203684832716283019655932542976 >>> intdiv(num, num2) 2648105301871818722187687529062555

Re: Problem with Python 3.5.0

2015-10-11 Thread Matt Wheeler
And if y do : > >>>> a="""test > . . . to > . . . see > . . . if > . . . it > . . . is > . . . working""" >>>>a > 'test\nto\nsee\nif\nit\nis\nworking' >>>> \n is an escape sequence rather than a comma

Re: Strong typing implementation for Python

2015-10-11 Thread Matt Wheeler
Cython to achieve what you want... ...but then you might start to see the benefits of dynamic typing :) -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Questions - July 25, 2015

2015-07-27 Thread Matt Wheeler
I'll just answer the one part I don't feel has had enough attention yet, all other parts chopped... On Sat, 25 Jul 2015 10:39 E.D.G. edgrs...@ix.netcom.com wrote: Posted by E.D.G. July 25, 2015 6. What is Python's version of the DOS level System command that many programs use as in: system

[issue6931] dreadful performance in difflib: ndiff and HtmlDiff

2013-03-21 Thread Matt Wheeler
Changes by Matt Wheeler m...@funkyhat.org: -- nosy: +funkyhat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6931 ___ ___ Python-bugs-list mailing