Re: Any ReST aware editors?

2016-09-22 Thread Yann Kaiser
if online is ok. > -- > https://mail.python.org/mailman/listinfo/python-list > -- Yann Kaiser kaiser.y...@gmail.com yann.kai...@efrei.net +33 6 51 64 01 89 https://github.com/epsy -- https://mail.python.org/mailman/listinfo/python-list

Re: sphinx (or other means to document python)

2016-09-24 Thread Yann Kaiser
he documentation as doctrings can be difficult, at > times > > noweb is considerably simpler - but does not allow for the extraction > of docstrings/comments - and does provide for a fairly painless way to > combine comments, documentation along with code > -- > https://mail

Re: How to reduce the DRY violation in this code

2016-09-28 Thread Yann Kaiser
unction from float to int in from_strings > > > Not to mention that each parameter is named seven times. > > > How can I improve this code to reduce the number of times I have to repeat > myself? > > > > > > -- > Steve > “Cheer up,” they said, “things could be worse.” So I cheered up, and sure > enough, things got worse. > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Yann Kaiser kaiser.y...@gmail.com yann.kai...@efrei.net +33 6 51 64 01 89 https://github.com/epsy -- https://mail.python.org/mailman/listinfo/python-list

Re: how to compile this code

2016-11-01 Thread Yann Kaiser
print(dir(node.left)) > if isinstance(node.op, ast.Add): > node.op = op2(node.left, node.right) > return node > > code = inspect.getsourcelines(solve) > tree = ast.parse(code) > tree = ChangeAddToMultiply().visit(tree) > ast.fix_missing_lo

Re: A problem with classes - derived type

2016-05-08 Thread Yann Kaiser
urn > a B object: > > class B(A): > ... > def f1(self, <...>): > ... > res=f(<...>) > > How do I return res as a B object? > > Thanks. > -- > https://mail.python.org/mailman/listinfo/python-list > -- Yann Kaiser kaiser.y...@gm

Re: Same function but different names with different set of default arguments

2016-01-20 Thread Yann Kaiser
partial treats keyword arguments as default values, though they become keyword-only as a result : f1 = functools.partial(g, p="p1") On Thu, Jan 21, 2016, 08:35 Paulo da Silva wrote: > Hi all. > > What is the fastest implementation of the following code? > > def g(p): > ... > ret

Re: How to simulate C style integer division?

2016-01-21 Thread Yann Kaiser
You can use the // operator, which should do what you want. On Thu, Jan 21, 2016, 09:40 Shiyao Ma wrote: > Hi, > > I wanna simulate C style integer division in Python3. > > So far what I've got is: > # a, b = 3, 4 > > import math > result = float(a) / b > if result > 0: > result = math.floor(r

Re: Same function but different names with different set of default arguments

2016-01-21 Thread Yann Kaiser
Apparently the thread poster cannot receive email, I just received a bounce on my previous email :-/ On Thu, Jan 21, 2016, 08:49 Yann Kaiser wrote: > partial treats keyword arguments as default values, though they become > keyword-only as a result : > > f1 = functools.partial(g, p=

Clize 3.0b1: An argument parser that draws a CLI from your function sigature

2015-04-27 Thread Yann Kaiser
Hello everyone! After a few years in development, I am proud to say Clize is landing its feet again and is now in beta for an upcoming release. You can try it out usingpip install --user clize=3.0b1and you can browse the docs athttps://clize.readthedocs.org/ For those who'd like an e

Re: Clize 3.0b1: An argument parser that draws a CLI from your function sigature

2015-04-28 Thread Yann Kaiser
On Mon, 27 Apr 2015 at 20:28 Chris Angelico wrote: > On Tue, Apr 28, 2015 at 12:45 PM, Yann Kaiser > wrote: > > On Mon, 27 Apr 2015 at 17:04 Chris Angelico wrote: > >> Interesting. I've also been working on a simpler arg handling module; > >> maybe we can wo

Re: Clize 3.0b1: An argument parser that draws a CLI from your function sigature

2015-04-28 Thread Yann Kaiser
On Mon, 27 Apr 2015 at 17:04 Chris Angelico wrote: > On Mon, Apr 27, 2015 at 7:02 PM, Yann Kaiser > wrote: > > Hello everyone! > > > > After a few years in development, I am proud to say Clize is landing its > > feet again and is now in beta for an upcoming relea

Re: Clize 3.0b1: An argument parser that draws a CLI from your function sigature

2015-04-28 Thread Yann Kaiser
On Mon, 27 Apr 2015 at 22:30 Ethan Furman wrote: > On 04/28, Chris Angelico wrote: > > > That's a lot of separate pieces. Here's the docstringargs equivalent: > > > > https://github.com/Rosuav/snippets/blob/dsa/snippets.py > > Just for grins, here's that using Scription: > > -- 8< ---

Re: Clize 3.0b1: An argument parser that draws a CLI from your function sigature

2015-04-28 Thread Yann Kaiser
On Tue, 28 Apr 2015 at 19:16 Chris Angelico wrote: > On Wed, Apr 29, 2015 at 11:55 AM, Yann Kaiser > wrote: > > I'm aware of the pattern, and I don't really like it, especially because > it > > gets weird when multiple modules are involved. You'd have to impo

Re: Clize 3.0b1: An argument parser that draws a CLI from your function sigature

2015-05-13 Thread Yann Kaiser
And... 3.0 is released! :-) Feel free to contact me or reply should you encounter any issues! http://clize.readthedocs.org/en/3.0/releases.html#v3-0 On Mon, 27 Apr 2015 at 02:02 Yann Kaiser wrote: > Hello everyone! > > After a few years in development, I am proud to say Clize is la

Re: Cheat sheet for the new string formatting?

2015-06-08 Thread Yann Kaiser
It just means significant digits in the general format, which alternates between 10-exponent notation and plain decimal notation. https://docs.python.org/3.4/library/string.html#format-specification-mini-language >>> '{:.3}'.format(0.356785) '3.57e-05' >>> '{:.3}'.format(0.0035678