With regard to | vs +, I honestly think the former would be *easier* for
beginners than the latter, because:
- Having a behavior that is unrelated to other uses of + would arguably be
harder to learn, or at least easier to misunderstand when you first see it.
- In the CS class world, many students
I believe Python 3.8's '=' f-string specifier (
https://docs.python.org/3/whatsnew/3.8.html#f-strings-support-for-self-documenting-expressions-and-debugging)
combined with __name__ does what you'd want:
return f'{self.__class__.__name__}({self.name=}, {self.age=})'
Outside of the __name__ dance,
This feels a lot like a really verbose way of having nulls-safe operators.
On Mon, Mar 2, 2020, 10:40 AM Soni L. wrote:
> All operations on None should raise a NoneError, which should be a
> TypeError for backwards compatibility.
>
> try:
>x = a[b][c][d][e][f] + g.foo(h)
> except NoneError:
;
>> >
>> > Rude? Who would it be rude to if we had chosen "anonfunc" instead of
>> > "lambda"?
>>
>> No, but it's no less jargonny.
>>
>> > Very few of us are computer scientists by profession. That's not even
&
re right. The worst reaction
> you are likely to get is an eye roll.
>
> / Kankyo (aka Anders)
> ___
> Python-ideas mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: ht
s.openstack.org/debtcollector/latest/reference/index.html
> Certain aspects of my implementation are inspired by it.
>
> Please let me know what you think about the idea in general
> and implementation in particular. If that's something the community
> is interested in, I'
.
Forgetting for a moment the charged context of the conversation itself,
does anyone have any opinions on how this would come to be?
Thank you for reading and hopefully listening,
-Ryan Birmingham
On Thu, 13 Sep 2018 at 23:03, Terry Reedy wrote:
> On 9/13/2018 7:34 PM, Tim Peters wrote:
&g
hodri James *-* Kynesim Ltd
> > > ___
> > > Python-ideas mailing list
> > > [email protected]
> > > https://mail.python.org/mailman/listinfo/python-ideas
> > > Code of Conduct: http://python.org/psf/codeo
on the details, this is just the summary off the top of my
> head.
>
> —
> I’m not saying this should be Python’s governance model, just to keep JS’
> in mind.
>
>
> ___
> Python-ideas mailing list
> [email protected]
seems like ALL_CAPS kind of came from macros being using for
constants in C and persisted.
--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
On Fri, Jan 4, 2019, 1:02 PM Abe Dillon I keep coming back to this great video <http
ity service award for his many
contributions.
--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
On Sun, Feb 3, 2019, 11:33 AM James Lu wrote:
> Are you a moderator or committed?
>
> I disagree with you. This, like the communica
Worth maybe noting that this could play interestingly with PEP 484?
--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
On May 4, 2019, 8:24 PM -0500, Serge Matveenko , wrote:
> Hi, all!
>
> I believe, almost everybody is fa
like that slice assignment makes much more sense.
-- Ryan
https://refi64.com/
On Jun 5, 2019, 2:56 AM -0500, Yanghao Hua , wrote:
> On Tue, Jun 4, 2019 at 12:47 PM Jeroen Demeyer wrote:
> >
> > I'd like to get rid of all the signal and HDL stuff (whatever that
> > means)
IME in many of these cases you're better off using asyncio instead.
-- Ryan
https://refi64.com/
On Jun 20, 2019, 12:14 AM -0500, Matúš Valo , wrote:
> Hi All,
>
> Currently it is not possible to "kill" thread which is blocked. The rationale
> for this is handlin
I feel like this could have some interesting side uses (typing on mobile so
ignore the crappy indentation):
with Namespace('a'):
x = 1
y = 2
print(a.__dict__) # we now have a dict
The GN build system flat-out has no dictionary / mapping type in favor of
scopes like this.
On Sun, Jul 28, 2019,
I think you might find plac[1] and fire[2] rather interesting. I do feel an
explicit __run__ would go against the spirit of "explicit is better than
implicit" a bit...
[1] https://micheles.github.io/plac/
[2] https://github.com/google/python-fire
On Tue, Jul 30, 2019, 8:03 PM wrote:
> Maybe th
Exception definitions in Python are not great. There are two main ways
they're used in the code that I've read:
1) By far the most common:
>>> class MyException(Exception):
... pass
>>> raise MyException(f'Bad thing happened during {action} in {context}')
2) Much rarer:
>>> class MyExceptio
n't be up
> for adding a new built-in exception as you're asking every book on Python
> to be rewritten to cover this which is no small thing.
>
> On Thu, Aug 8, 2019 at 8:56 AM Ryan Fox wrote:
>
>> Exception definitions in Python are not great. There are two
d to continue this discussion.
On Thu, Aug 8, 2019 at 4:12 PM Andrew Barnert wrote:
> On Aug 8, 2019, at 08:52, Ryan Fox wrote:
> >
> > >>> class MyException(Exception):
> > ... def __init__(self, action, context):
> > ... super().__init__(f
t;
>>
>>
>> On Thu, Aug 8, 2019 at 5:24 PM Sebastian Kreft wrote:
>>
>>>
>>>
>>> On Thu, Aug 8, 2019 at 7:09 PM Andrew Barnert via Python-ideas <
>>> [email protected]> wrote:
>>>
>>>> On Aug 8, 2019, at
I believe you want Python 3.7's parse_intermixed_args:
https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.parse_intermixed_args
A quick test seems to work:
import argparse
p = argparse.ArgumentParser()
p.add_argument('files', nargs='*')
p.add_argument('-f', '--force', actio
p my code read better without changing any semantics.
>>
>> Feedback is welcome!
>>
>> Shane
>> ___
>> Python-ideas mailing list
>> [email protected]
>> https://mail.python.org/mailman/listinfo/python-ideas
>
> On Sep 1, 2016, at 1:40 AM, Greg Ewing wrote:
>
> Guido van Rossum wrote:
>> Would this be enforced in the grammar or by the lexer? Since you say
>> you expect the indentation to be enforced, that suggests it would be
>> done by the grammar,
>
> I think it could be done by having the lexer en
> Hugh Fisher
> ___
> Python-ideas mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
--
Ryan
[ERROR]: Your autotools build scrip
https://github.com/kirbyfan64/_frozensafemockobjectimplementation
In all seriousness, though, I really feel like that would be the ultimate
bug magnet, since it'd be easy to forget to un-wrap the object afterwards.
--
Ryan
[ERROR]: Your autotools build scripts are 200 lines longer than
FYI, pytest already does this:
http://doc.pytest.org/en/latest/
--
Ryan
[ERROR]: Your autotools build scripts are 200 lines longer than your
program. Something’s wrong.
http://kirbyfan64.github.io/
On Sep 17, 2016 7:55 PM, "Arek Bulski" wrote:
> I am using declarative testing a lo
ecent call last):
...
MissingPackageError: This script requires package(s) which are not
installed: mypackage>=1.0, other_package
That way, you don't get the weird import errors, but you don't have to
worry about all the subtleties of automatic downloading.
--
Ryan
[ERROR]: Your autotools build scripts ar
;
>
>
>
> --
> --Guido van Rossum (python.org/~guido)
>
> ___
> Python-ideas mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct
'll have forgotten that I need to start the line with a space :)
Until you end up with like 20 merge conflicts because some editors strip
trailing whitespace...
>
> Best,
> Erik
> ___
> Python-ideas mailing list
> Python-ideas@p
That discussion seemed to mostly just conclude that dicts shouldn't have
all set operations, and then it kind of just dropped off. No one really
argued the subset part.
--
Ryan
[ERROR]: Your autotools build scripts are 200 lines longer than your
program. Something’s wrong.
http://kirby
gt; ___
> Python-ideas mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
--
Ryan (ライアン)
[ERROR]: Your autotools build scripts are 200 lines longer
ilman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
--
Ryan (ライアン)
[ERROR]: Your autotools build scripts are 200 lines longer than your
program. Something’s wrong.
http://kirbyfan64.github.io/
___
Python-ideas mailing li
if it has come up before,
and if there are any compatibility issues that I'm not seeing here.
Thank you,
-Ryan Birmingham
___
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code o
I was thinking of using them only as possibly quotes characters, as
students and beginners seem to have difficulties due to this quote-mismatch
error. That OSX has smart quotes enabled by default makes this a worthwhile
consideration, in my opinion.
-Ryan Birmingham
On 22 October 2016 at 01:34
typographical characters.
-Ryan Birmingham
On 22 October 2016 at 02:35, Steven D'Aprano wrote:
> On Sat, Oct 22, 2016 at 01:17:58AM -0400, Ryan Birmingham wrote:
> > Hello everyone,
> >
> > I want to start small and ask about smart/curly quote marks (” vs ").
>
>
Per the comments in this thread, I believe that a better error message for
this case would be a reasonable way to fix the use case around this issue.
It can be difficult to notice that your quotes are curved if you don't know
that's what you're looking for.
-Ryan Birmingham
On 22
I also believe that using a text file would not be the best solution; using
a dictionary, other data structure, or anonomyous function would make more
sense than having a specially formatted file.
On Oct 24, 2016 13:45, "Chris Barker" wrote:
> my thought on this:
>
> If you need translate() you
call last):
File "", line 1, in
File "", line 2, in __init__
AssertionError
to:
Traceback (most recent call last):
File "", line 1, in
File "", line 2, in MyClass.__init__
AssertionError
which could make it easier to find where exactly an error or
So, based on everyone's feedback, I just created this:
http://bugs.python.org/issue28536
On Mon, Oct 24, 2016 at 5:07 PM, Ryan Gonzalez wrote:
> I personally find it kind of annoying when you have code like this:
>
>
> x = A(1, B(2, 3))
>
>
> and Python'
Also, as an extension of this idea, would it be possible to improve errors
like this:
class X: pass
X() # object() takes no parameters
to show the actual type instead of just 'object'?
On Tue, Oct 25, 2016 at 4:48 PM, Ryan Gonzalez wrote:
> So, based on everyone's feedba
Yeah, I just checked the source and tried changing it. Seems to work well.
On Tue, Oct 25, 2016 at 8:11 PM, Steven D'Aprano
wrote:
> On Tue, Oct 25, 2016 at 04:55:21PM -0500, Ryan Gonzalez wrote:
> > Also, as an extension of this idea, would it be possible to improve
> err
I'd certainly be interested in hearing about how this has worked with C++,
but this would certainly make scientific code less easy to misuse due to
unclear units.
-Ryan Birmingham
On 28 October 2016 at 16:45, Sven R. Kunze wrote:
> On 28.10.2016 22:06, MRAB wrote:
>
>> On
I certainly like the concept, but I worry that use of __exists__() could
generalize it a bit beyond what you're intending in practice. It seems like
this should only check if an object exists, and that adding the magic
method would only lead to confusion.
-Ryan Birmingham
On 28 October 20
object idiom could be rewritten as::
>
> class Maybe:
> SENTINEL = object()
> def __init__(self, value):
> self._result = (value,) is value is not self.SENTINEL else ()
> def __exists__(self):
> return self._result
o teach, as opposed
to changing them.
-Ryan Birmingham
On 7 November 2016 at 23:49, Stephen J. Turnbull <
[email protected]> wrote:
> Nathan Dunn writes:
>
> > > * the mapping protocol covers more than just __getitem__
> >
> > __setitem__(self, key
f) else
obj.field.of.interest
obj.get('field', {}).get('of', {}).get('interest')
(The first example shows how it would be handled with the PEP in its
current state.)
Maybe these are too far out of scope, I'm not sure. They feel very similar
to me though.
>
> No, the conditional branching would be based on exists.__bool__ (or,
> in the current working draft, is_not_none.__bool__), and that would be
> "0 is not None", which would be True and hence short-circuit.
>
>
> `__then__` is responsible for *unwrapping* the original value from the
> circuit b
then thought, oh that would
> be too pedantic.
> You say you have no time and write a whole page about it,
> so don't blame me that I take too much time from you.
>
> Mikhail
> ___
> Python-ideas mailing list
> [email protected]
> htt
esult
# repeat
return hasher.hash
[1]:
https://hg.python.org/cpython/file/dcced3bd22fe/Objects/tupleobject.c#l331
[2]:
https://bitbucket.org/pypy/pypy/src/d8febc18447e1f785a384d52413a345d7b3db423/rpython/rlib/objectmodel.py#objectmodel.py-562
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercel
thon is the way
it is because that's the way it is, and we like it that way.
___
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
--
Ryan (ライアン)
Yoko Shimomura > ry
I think that replying with an almost canned response, like the one Ned
proposed ("unless you are seriously proposing a change to the language,
this is not the right list."), would help discourage other list members
from responding where responses aren't necessary.
-Ryan Birmingham
As another suggestion, I'd love an rmtree method analogous to shutil.rmtree.
And maybe also a remove method, that basically does:
if path.is_dir():
path.rmtree()
else:
path.unlink()
\--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiro
hen move to 2.7 being substantially smaller, then eventually to
dropping 2.7.
-Ryan Birmingham
On 26 January 2017 at 11:11, Victor Stinner
wrote:
> Hi,
>
> The download button of https://www.python.org/ currently gives the
> choice between Python 2.7 and 3.6. I read more and more ar
https://github.com/kirbyfan64/mirasu
\--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
<http://refi64.com/>
___
Python-ideas mailing list
[email protected]
https://mail.python.or
rt is solely so that slices would be allowed in the syntax, but
if you guys don't like the idea, the second part still stands.
Thoughts? *ducks from flying tomatoes*
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone
So, to make sure I have this right: your proposal says array should be
indexable by a list of indexes as they're currently done, in a tuple,
right? Would this also mean that something like (1:4, 8:10, 13) should be
an acceptable constructor for a tuple?
-Ryan Birmingham
On 20 February 2017
It sorts the list in place. Can you use sorted(item_list)?
-Ryan Birmingham
On 26 February 2017 at 22:07, qhlonline wrote:
> Hi, all
> I have a suggestion that, the sort() member method of the list
> instance, should return the 'self' as the result of list.sort() call.
I'm sorry for the confusion, but what is frozen_tree_set() here, and what
is ipop? frozensets don't have pop or 'ipop', so my apologies that I'm a
bit lost here.
-Ryan Birmingham
On 28 February 2017 at 08:59, 语言破碎处 wrote:
>
> Hi!
> I write a '<
> On Feb 28, 2017, at 8:14 PM, 语言破碎处 wrote:
>
> We need not care other functions, just the "current" one.
> Other functions are definitely out of our control.
> My last example distinguish 3 cases:
> self.f()# object/overloaded version
> __class__.f(self) # decorated ve
By itself, I don't see using the ``in`` syntax to check for ``instanceof`` as a
big benefit, given the overhead of learning that new concept. However, given in
the light of a bigger concept, I think it may make more sense.
If we accept that it may be desirable to work with types as set-like obje
o I understand where a
desire like this would come from. Would more specific and succinct
documentation on this change alone help?
-Ryan Birmingham
On 3 March 2017 at 06:44, Thomas Güttler
wrote:
> I found this in an old post:
>
> > Maybe too late now but there should have been 'unicode
Ever looked up cffi? You won't be disappointed.
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
http://refi64.com
On Mar 7, 2017 3:43 AM, "George Fischhof" wrote:
> Hi Guys,
>
> right now I had to call functions fr
gument to print? That way, I
could've just done:
print(mystring, errors='replace')
without having to worry about it crashing.
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
http://refi64.com
__
FWIW, using the ascii function does have the problem that Unicose
characters will be escaped, even if the terminal could have handled them
perfectly fine.
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
http://refi64.com
On Mar 26, 2017 9:
kage.
>(PS. i would love to develop a new IDE of my own even if that is
> besides GSoc )
>
> ___
> Python-ideas mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/co
I feel like that borders on a bit too wordy...
Personally, I'd like to see something like Felix's regular definitions:
http://felix-lang.org/share/src/web/tut/regexp_01.fdoc#Regular_definitions._h
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >&
Have you tried PyParsing and/or Grako? They're some of my favorites (well,
I like PLY too, but I'm thinking you wouldn't like it too much).
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
http://refi64.com
On Apr 3, 2017 3:2
...except it would break everybody who has a module named `me` (which
admittedly isn't too common...).
Something like `import this.what` or something like that would be cool,
though.
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
http
y much any other variable name,
yet there's no other real use case outside of methods.
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
http://refi64.com
On Apr 24, 2017 8:08 PM, "Erik" wrote:
> Hi. I suspect that this may h
letting
> people eliminate a lot of the boilerplate currently involved in
> writing classes that produce nice and easy to use instances.
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan | [email protected] | Brisbane, Australia
> _____
I guess maybe if you overload the operators to return broken objects, maybe
then they would be different?
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
http://refi64.com
On May 15, 2017 9:50 AM, "Serhiy Storchaka" wrote:
>
Sometimes I feel that it would be neat of dict constructors (like proposed
previously in the thread) could also be chained, e.g.:
dict.ordered.default(int)(a=1, b=2)
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
http://refi64.com
On May 2
nts do NOT have halfwidth support.
Is this correct?
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
http://refi64.com
On Jun 1, 2017 2:27 PM, "Masayuki YAMAMOTO"
wrote:
Hi Stephan,
Nevertheless, I would like to point out that the
/tutorials/2.3/
(I mean, it would be even nicer to have a "jump to latest version" for
*all* not-new Python versions, though I figured just 2 would be a lot
easier.)
--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
h
return result
>
> This is brittle and doesn't even cover slots. Requiring the use of
> module-level names simplifies runtime evaluation and provides the
> "one obvious way" to read annotations. It's the equivalent of absolute
> imports.
>
>
> Ackn
ter way?
>
> Cheers,
> -Barry
>
> ___
> Python-ideas mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
--
Ryan (ライアン)
Yoko Sh
o/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>>
>
> ___
> Python-ideas mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http:/
too complicated though, I can't
estimated or understand this...
thx for reading,
Marius
___
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
t. In other
words, this would be illegal:
local(a=1)
and you would have to do this:
local(a=1, a)
Now if the user mixes up = and ==, it'd be a "compile-time error".
--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
I'm pretty sure the debate about braces defining scope in Python has
long-since ended...
--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
On April 28, 2018 9:37:57 PM Ken Hilton wrote:
> local { m = re.matc
nsequences of what I explicitly asked for".
[1] https://www.python.org/dev/peps/pep-0572/
___
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduc
.
>>
>> How much support was there for ":="? Are you serious about bringing
>> back Pascal and Algol from their comfortable resting places?
>>
> ___
> Python-ideas mailing list
> [email protected]
> ht
On May 11, 2018 1:45:27 PM Tim Peters wrote:
[Brendan Barnwell]
. . . and it's true the latter is a bit more verbose in that case for
little extra benefit. But when the locally-defined value is used within
a more complicated expression (like the quadratic formula example), I
think readabilit
You could always do e.g. math.sin(math.degress(radians)) and so forth...
On June 7, 2018 3:07:21 PM Robert Vanden Eynde
wrote:
I suggest adding degrees version of the trigonometric functions in the math
module.
- Useful in Teaching and replacing calculators by python, importing
something
^ is also used in regexes for matching the *beginning* of a string...
Realistically, I don't think this proposal would be added, but if it were,
^ would be a horrible choice.
That being said, I do understand the feeling of half your code being calls
to .append or .extend. You could always do:
I *think* he's referring to something like this:
class A(enum.Enum):
class Inner(NamedTuple):
...
isinstance(A.Inner(), A()) # True
I *think* that's it.
On June 27, 2018 2:26:23 PM Ethan Furman wrote:
On 06/27/2018 12:04 PM, Elazar wrote:
> בתאריך יום ד׳, 27 ביוני 2018, 11:59,
If you want to get source code from an AST, you'd probably be better off
with a more fully-featured library like Astor:
https://github.com/berkerpeksag/astor
On July 12, 2018 1:21:23 PM Andre Roberge wrote:
In the cPython repository, there is an unparse module in the Tools section.
https://
87 matches
Mail list logo