[Python-ideas] Re: Idea: Extend "for ... else ..." to allow "for ... if break ..." else

2020-08-05 Thread Rob Cliffe via Python-ideas
an exception         if :             break 42     except "oops":             except 42:             except break:         # catches all "break"s not already explicitly caught         pass     else:         print("Did not break") Rob Cliffe _

[Python-ideas] Re: Idea: Extend "for ... else ..." to allow "for ... if break ..." else

2020-08-06 Thread Rob Cliffe via Python-ideas
e asking a lot. Guido replied: Rest assured this is not a problem. In any case it’s the compiler, not the parser, that generates the bytecode, from the AST. The compiler always has the full AST available before it is asked to generate any bytecode. The new parser just allows more flexible syntactic

[Python-ideas] Re: Inline Try-Except Clause

2020-08-06 Thread Rob Cliffe via Python-ideas
ro" # No you didn't, you got a NameError. (Unless your proposal was specifically to catch just KeyError (or some other fixed, small set of exceptions) which would greatly limit its usefulness.  I assume it wasn't.) Best wishes Rob Cliffe _____

[Python-ideas] Re: Inline Try-Except Clause

2020-08-06 Thread Rob Cliffe via Python-ideas
ments, like min() and max() functions for example. It would be great if this PEP were to be resurrected. +1. Rob Cliffe ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.pyth

[Python-ideas] Re: Inline Try-Except Clause

2020-08-06 Thread Rob Cliffe via Python-ideas
is the PEP 463 syntax? > > Though you'd almost certainly want to use a more specific exception. True. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected]

[Python-ideas] Re: Inline Try-Except Clause

2020-08-06 Thread Rob Cliffe via Python-ideas
th default` Er, how is this different from     (value = func() except Exception: default) which is the PEP 463 syntax? Though you'd almost certainly want to use a more specific exception. True. _______ Python-ideas mailing list -- [email protected]

[Python-ideas] Re: Inline Try-Except Clause

2020-08-07 Thread Rob Cliffe via Python-ideas
the position that EAFP is better than LBYL, or "generally recommended" by Python. (Where do you get that? From the same sources that are so obsessed with DRY they'd rather introduce a higher-order-function than repeat one line of code? :-)* OK, some of the arguments are a bit exagg

[Python-ideas] Re: Inline Try-Except Clause

2020-08-07 Thread Rob Cliffe via Python-ideas
if you read the PEP. Dict display and slices are hardly of "very limited" use.  (I can't comment on annotations, I don't use them.) Even the "if" expression does not use it. _______ Python-ideas mailing list -- python-ideas

[Python-ideas] Re: Inline Try-Except Clause

2020-08-07 Thread Rob Cliffe via Python-ideas
On 07/08/2020 16:58, Guido van Rossum wrote: On Fri, Aug 7, 2020 at 8:15 AM David Mertz <mailto:[email protected]>> wrote: I think getting Guido on board would be a huge step. Python has added quite a bit of new syntax since 2014, and Guido himself is currently advocatin

[Python-ideas] Re: Inline Try-Except Clause

2020-08-08 Thread Rob Cliffe via Python-ideas
On 08/08/2020 02:16, Steven D'Aprano wrote: On Fri, Aug 07, 2020 at 06:40:33PM +0100, Rob Cliffe via Python-ideas wrote: On 07/08/2020 17:16, Serhiy Storchaka wrote: The main problem to me with the exception catching expression is that you need to add the exception name and several key

[Python-ideas] Re: default parameter in fuctions to clean up flow

2020-08-11 Thread Anthony Flury via Python-ideas
11 Aug 2020, at 14:41, William Pickard wrote: > > What you're running into is how Python handles default arguments. > > Take this for example: > def my_func(seq=[]): >print(seq) >seq.append(42) >print(seq) > > my_func() > # [] > # [42]

[Python-ideas] Re: raise TypeError when giving wrong type of argument in functions

2020-08-22 Thread Ronald Oussoren via Python-ideas
: > raise TypeError('nom1 and nom2 should be int') > print(sum('hello',2)) > > But if they can add what am I am i saying it can decrease lines of this > function by 50% and also function author should not worry about checking > types anymore! > (I

[Python-ideas] Re: Type Implications in Python 4 (or 3.9)

2020-08-26 Thread Ronald Oussoren via Python-ideas
> On 26 Aug 2020, at 17:02, [email protected] wrote: > > One suggestion I had for the next Python release is to add type-implication > support. Many developers have learned Python, but do not want to use it since > it is slow. An awesome way to fix this is to hav

[Python-ideas] wrapping up 4 years of open source python > 12 pep ideas

2020-09-07 Thread Sylvain MARIE via Python-ideas
Dear python enthusiasts, --(you can skip this part if you're in a hurry)-- 4 years ago I was discovering this great language. Already an experienced software developer and data scientist at that time, accustomed with both low-level (C++), Object-Oriented (Java), Query (T-SQL), and S

[Python-ideas] Re: A shortcut to load a JSON file into a dict : json.loadf

2020-09-16 Thread Rob Cliffe via Python-ideas
only accepts strict JSON. loadf:     ...     loadf only accepts strict JSON.  This is different from loads which blah-blah-blah Etc. Rob Cliffe ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ide

[Python-ideas] Re: f-strings as assignment targets

2020-09-19 Thread Rob Cliffe via Python-ideas
any other cases: >>> a[n] = 17 >>> a[n] == 17 True >>> obj.x = "foo" >>> obj.x == "foo" True # Proposed: >>> f"It is {hh}:{mm} {am_or_pm}" = "It is 11:45 PM" >>&g

[Python-ideas] Re: Suggestion: annotated exceptions

2020-09-26 Thread Sascha Schlemmer via Python-ideas
alid inputs to the function and this effectively pushes the error handling/ input validation out of `div` A language that does all this really well is F# (which like python is a multi-paradigm language that offers both object-oriented and functional-programming-oriented constructs). The troubl

[Python-ideas] Improved Error Message for "Unhashable Type"

2020-09-28 Thread Samuel Freilich via Python-ideas
The error message for using a mutable sequence as a set item or map key seems to frequently confuse Python beginners. The current wording is: >>> {[1, 2, 3]: [4, 5, 6]} TypeError: unhashable type: 'list' The first thing a Google search finds for "unhashable type"

[Python-ideas] Re: Improved Error Message for "Unhashable Type"

2020-09-28 Thread Samuel Freilich via Python-ideas
sion. I do think it can be useful to have more direct links to documentation, though. > at least add "unhashable" to the glossary -- after all, both "mutable" and "immutable" are in there. I think that's reasonable. On Mon, Sep 28, 2020 at 11:41 AM Christophe

[Python-ideas] Re: CPP Namespaces For Python

2020-10-06 Thread Irit Katriel via Python-ideas
Hi Alperen,  Why do you need a class at all rather than just a module with some functions? Irit On Tuesday, October 6, 2020, 01:38:21 PM GMT+1, Alperen Keleş wrote: Hi, Please pardon me if my idea is not making sense or already exists, I'm kind of new to developing in Python but

[Python-ideas] Variadic generics PEP draft

2020-10-07 Thread Matthew Rahtz via Python-ideas
, Vincent Siles Sponsor:TODO Status:Draft Type:Standards Track Content-Type:text/x-rst Created:16-Sep-2020 Python-Version:3.10 Post-History:07-Oct-2020 Contents Abstract Motivation Parameter-transforming Functions Arbitrary-length Inhomogeneous Tuples Tensor Shapes Specificati

[Python-ideas] Re: Exceptions as function calls to kill boilerplate

2020-10-13 Thread Ronald Oussoren via Python-ideas
rmediary class definition? I use string literals for state > names all the time instead of creating objects and importing them all over my > code because most of the time the mental overhead of imports and the like > isn't worth the ease and clarity of just passing a string. This

[Python-ideas] Re: Weakrefs for lru_cache?

2020-10-15 Thread Irit Katriel via Python-ideas
interesting debates about who’s fault it is. Irit > On 15 Oct 2020, at 18:53, Ram Rachum wrote: > >  > Hi everyone, > > For many years, I've used a `cache` decorator that I built for caching Python > functions. Then `functools.lru_cache` was implemented, whic

[Python-ideas] Re: except-try block

2020-10-15 Thread Rob Cliffe via Python-ideas
   except AnotherError:         pass     else:         return     try:     something_completely_different     except Whatever:     return NotImplemented     else:         return I sometimes wish that Python provided nicer syntax for writing a "pseudo-loop", but I guess it's not an u

[Python-ideas] Re: except-try block

2020-10-15 Thread Rob Cliffe via Python-ideas
On 16/10/2020 01:36, Chris Angelico wrote: On Fri, Oct 16, 2020 at 10:45 AM Rob Cliffe via Python-ideas wrote: One workaround I sometimes use is a pseudo-loop which is executed once only; whenever the process can be abandoned, I `break` out of the "loop". It ain't particular

[Python-ideas] Re: Weakrefs for lru_cache?

2020-10-16 Thread Irit Katriel via Python-ideas
quire manually keeping track of these attributes for each method I'm caching. I do that sometimes, but it's verbose.  ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://

[Python-ideas] Re: Weakrefs for lru_cache?

2020-10-16 Thread Irit Katriel via Python-ideas
what you meant? That's what I'm trying to avoid, doing all that manual work that a cache decorator is supposed to do for me in one line. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ide

[Python-ideas] Re: New feature

2020-10-16 Thread Rob Cliffe via Python-ideas
reen and display the updated information. Rob Cliffe ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Messag

[Python-ideas] Re: except-try block

2020-10-16 Thread Rob Cliffe via Python-ideas
t overhead.  My apps usually aren't.) Rob Cliffe ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Messag

[Python-ideas] Re: New feature

2020-10-16 Thread Rob Cliffe via Python-ideas
On 16/10/2020 11:59, Chris Angelico wrote: On Fri, Oct 16, 2020 at 8:21 PM Rob Cliffe via Python-ideas wrote: On 13/10/2020 23:35, Guido van Rossum wrote: Can one of the educators on the list explain why this is such a commonly required feature? I literally never feel the need to clear

[Python-ideas] Re: New feature

2020-10-16 Thread Rob Cliffe via Python-ideas
ot it working!  The answer is \x1b[1A Thanks for the pointer! Rob Cliffe ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Me

[Python-ideas] Re: New feature

2020-10-16 Thread Rob Cliffe via Python-ideas
On 16/10/2020 13:55, Chris Angelico wrote: On Fri, Oct 16, 2020 at 11:08 PM Rob Cliffe wrote: On 16/10/2020 11:59, Chris Angelico wrote: On Fri, Oct 16, 2020 at 8:21 PM Rob Cliffe via Python-ideas wrote: On 13/10/2020 23:35, Guido van Rossum wrote: Can one of the educators on the list

[Python-ideas] Re: New feature

2020-10-16 Thread Rob Cliffe via Python-ideas
s use case. But I would not want to install a module on pypi that made use of this. From a software perspective this is 100% bad practice, but from a practitioner perspective --- and there are a lot of practitioners that only use Python as a tool (like a DSL) --- I can see wanting it. So, that&

[Python-ideas] Re: New feature

2020-10-17 Thread Rob Cliffe via Python-ideas
st wishes Rob Cliffe ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/pyt

[Python-ideas] Re: 'Infinity' constant in Python

2020-10-17 Thread Rob Cliffe via Python-ideas
incorrect: x / 2 is unsolvable because x could be infinity x / 2 > x / 3 (where x > 0; Z+) is indeterminate because if x is infinity, then they are equal. Which of these are you arguing should fail if Python changes to returning [+/-]inf instead of raising ZeroDivisionError? as

[Python-ideas] Re: Bringing the print statement back

2020-10-20 Thread Rob Cliffe via Python-ideas
en though bare print statements are nicer for debugging than parenthesis based debug statements. ___ Python-ideas mailing list -- [email protected] <mailto:[email protected]> To unsubscribe send an email to [email protected]

[Python-ideas] Re: f-strings as assignment targets

2020-10-20 Thread Rob Cliffe via Python-ideas
s a really *obscure* and *non-obvious* way of assigning to variables.  I doubt that anybody could readily guess the meaning when seeing it for the first time.  (Frankly, I don't care if something similar has been implemented in Scala - I still think it's horrible for Python.)     - Would add

[Python-ideas] Re: Dict unpacking assignment

2020-10-24 Thread Patrick Haller via Python-ideas
is clearly readable. In your example I had to look twice that the 'Response' is the pattern which is matched from the 'get' result. But in the end this argument also applies to the already implemented walrus operator, so there is that. Patrick ______

[Python-ideas] Re: execute function on iterator items without changing or consuming iterator

2020-10-25 Thread Samuel Freilich via Python-ideas
eek for similar functionality, while Stream.forEach is analogous to Python's map. On Sun, Oct 25, 2020 at 9:02 AM wrote: > Python has many tools for iteration, such as map and filter, that change > an iterator into another iterator without consuming the iterator. These > make it simp

[Python-ideas] Re: Global flag for whether a module is __main__

2020-11-12 Thread Rob Cliffe via Python-ideas
ow that: 1. the script you ask Python to run is technically a module, 2. every module has a unique name assigned to it, 3. a module's `__name__` global stores this unique import name, 4. and "__main__" is a magic name for the initial script's module. But that'

[Python-ideas] Re: Global flag for whether a module is __main__

2020-11-13 Thread Henshaw, Andy via Python-ideas
proposed if __main__: André ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-19 Thread Ronald Oussoren via Python-ideas
> On 19 Nov 2020, at 08:48, Paul Moore wrote: > > On Thu, 19 Nov 2020 at 07:42, Stéfane Fermigier wrote: > >> But cooperation between the PyInstaller team and the Python Packaging >> Authority, if this doesn't happen already, could probably help. > > It

[Python-ideas] Re: 'Infinity' constant in Python

2020-11-20 Thread Rob Cliffe via Python-ideas
Correction to previous post: On 11/10/2020 22:47, Wes Turner wrote: Which of these are you arguing should fail if Python changes to returning [+/-]inf instead of raising ZeroDivisionError? assert inf / inf == 1 That should raise an exception; inf/inf is meaningless (just as division

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-20 Thread Ronald Oussoren via Python-ideas
the advantages of a single runnable file, and >>> all the advantages of NOT including the full Python interpreter with >>> it. It is questionable if not including the interpreter is an advantage. One use case for tools like pyinstaller to to ship applications to end users. Having to

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-20 Thread Ronald Oussoren via Python-ideas
> On 20 Nov 2020, at 08:13, Abdur-Rahmaan Janhangeer > wrote: > > > - Some people, including me, don't think at this point this is a good idea > > to integrate PyInstaller in the Python code base. > > The maintainer of Py2App said > > > FWIW I don

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-20 Thread Ronald Oussoren via Python-ideas
t; for a bunch of popular libraries to make them work. > > I've seen this sort of thing in other app bundlers too, e.g. > last time I looked py2app and py2exe had a bunch of special casing > for various libraries. > > This is quite a big problem, IMO. It makes these tools ver

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-20 Thread Ronald Oussoren via Python-ideas
libraries. >> >> This is quite a big problem, IMO. It makes these tools very >> flakey. >> >> What is it about app bundling in Python that makes these things >> necessary? Something seems very wrong somewhere. > > To be honest, I think it's more a case

[Python-ideas] Re: A pypi-based app store solution for platform specific installation

2020-11-21 Thread Ronald Oussoren via Python-ideas
mmand line. That said, using PyPI in this way is not necessarily useful even ignoring platforms where side-loading is frowned upon or even impossible. As a user of applications I don’t really care in what language an application is written in, I don’t wan to look in the Python App Store, or the C# Ap

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-22 Thread Ronald Oussoren via Python-ideas
treat it as a single project other than for the release artefacts on PyPI) It is probably easier to develop a metadata standard that specifies how packages can be split up by app bundling tools. Ronald — Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ ___

[Python-ideas] Re: Adding PyInstaller to the standard library

2020-11-24 Thread Ronald Oussoren via Python-ideas
t;> >>>> But it's not as limiting as you suggest - it *does* preclude most >>>> scientific use (because of numpy etc) but (for example) a large number >>>> of web libraries are pure Python. >>> >>> Not sure what you mean here, but whil

[Python-ideas] [RFC] Built-in shorthand b() for breakpoint()

2020-12-02 Thread Qingyao Sun via Python-ideas
`set_trace()` anyway. The use cases Barry and I are addressing are scenarios where one is forced to use limited toolings, such as fixing a Python helper script shipped with a third-party application, or troubleshooting on a remote/embedded machine. In interactive workflows like debugging, every keys

[Python-ideas] Re: [RFC] Built-in shorthand b() for breakpoint()

2020-12-02 Thread Qingyao Sun via Python-ideas
the 27-character command sequence >`import pdb; pdb.set_trace()` with the 12-character `breakpoint()`. I want to >take it one step further because 12 characters is still unnecessary wordy. Qingyao ___ Python-ideas mailing list -- [email protected] T

[Python-ideas] Re: Make for/while loops nameable.

2020-12-04 Thread Rob Cliffe via Python-ideas
as written, and rejected by Guido. Rob Cliffe ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://

[Python-ideas] Re: tkinter Variable implementation

2020-12-13 Thread Ronald Oussoren via Python-ideas
_default_root > 335 > if not master: > 336 > raise RuntimeError(f"{self.__class__.__name__!r}: > 'master' must be defined or a Tk instance must be present!") > 337 > self._root = master._root() > > ... and not relying on this inexplicable Attrib

Re: [Python-ideas] Overloading operators for testing

2016-09-20 Thread Mark Lawrence via Python-ideas
n.org/pypi/nose2/0.6.5 https://github.com/nose-devs/nose2 -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence ___ Python-ideas mailing list [email protected] https://mail.pytho

Re: [Python-ideas] Suggestion: Clear screen command for the REPL

2016-09-27 Thread Dennis Brakhane via Python-ideas
I don't know if it works on Windows, but at least in Linux pressing Ctrl-L will do exactly what you describe (as long as the REPL uses readline) On 17.09.2016 12:51, João Matos wrote: > Hello, > > I would like to suggest adding a clear command (not function) to Python. > It'

Re: [Python-ideas] Add "equal" builtin function

2016-10-06 Thread Mark Lawrence via Python-ideas
's not really that important. A motivating reason for adding it to the builtins would be that it can be written in C instead of Python, and hence be a lot faster. This should be on the bug tracker as "release blocker" as we clearly need something that is fast that isn't that imp

Re: [Python-ideas] Fwd: Fwd: Fwd: unpacking generalisations for list comprehension

2016-10-16 Thread Mark Lawrence via Python-ideas
m of every python mailing list email.https://www.python.org/psf/codeofconduct/ <https://www.python.org/psf/codeofconduct/> I don't find teaching children is a laughing matter, neither is the idea of children learning to code. In Canada, we have initiatives like Girls Learning Code and

Re: [Python-ideas] Multiple level sorting in python where the order of some levels may or may not be reversed

2016-10-17 Thread Mark Lawrence via Python-ideas
rence ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] please try to keep things civil

2016-10-21 Thread Mark Lawrence via Python-ideas
On 17/10/2016 19:29, Brett Cannon wrote: On Sun, 16 Oct 2016 at 09:39 Mark Lawrence via Python-ideas mailto:[email protected]>> wrote: On 16/10/2016 16:41, Mariatta Wijaya wrote: >>Her reaction was hilarious: >> >>"Whom does he teach? C

Re: [Python-ideas] A better interactive prompt

2016-10-26 Thread Mark Lawrence via Python-ideas
nteractive environment, that is *always* present, even if parts of the interpreter (most notably the import system) aren't working or have been deliberately disabled - a day-to-day working environment for Python developers The prevalence of the latter use case then leads to it also being use

Re: [Python-ideas] get() method for list and tuples

2017-03-05 Thread Mark Lawrence via Python-ideas
ve to github. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence _______ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] PEP: Python Documentation Translations

2017-03-21 Thread Julien Palard via Python-ideas
Hi, Here is the follow-up to the "Translated Python documentation" thread on python-dev [1]_, as a PEP describing the steps to make Python Documentation Translation official on accessible on docs.python.org. .. [1] [Python-Dev] Translated Python documentation (https://mail.python.org

Re: [Python-ideas] PEP: Python Documentation Translations

2017-03-22 Thread Julien Palard via Python-ideas
e. It's a more a sphinx-doc issue than a python doc issue, but it still should be adressed, see "Enhance rendering of untranslated fuzzy translations". About switching version in the same language: A 404 can occur, but is already handled by the current version switcher, which p

Re: [Python-ideas] PEP: Python Documentation Translations

2017-03-23 Thread Julien Palard via Python-ideas
Hi, So it seems ok to move to the Python organization, github.com/python, rather than using a different organization. What do you think? I think it make more sense, so if it's possible, let's do it, I updated the PEP. -- Julien Pa

[Python-ideas] IDEA

2017-03-26 Thread Faaiz Asim via Python-ideas
Hi, I am currently enrolled in computer science program and am currently in 6th semester. I am comfortable using c++,java,python in general. I know this is a little late for proposing an idea but i was busy in exams. Besides i wanted to get into something where i was determined to contribute to

Re: [Python-ideas] Way to repeat other than "for _ in range(x)"

2017-03-30 Thread Suresh V. via Python-ideas
ng to do, and while the benefit doesn't seem much, something like this would be much prettier and more pythonic than using underscore variable: d = [[0] * 5 repeat_for 10] Why not: d = [[0] * 5 ] * 10 _______ Python-ideas mailing list Python-ideas@

Re: [Python-ideas] What about regexp string litterals : re".*" ?

2017-04-02 Thread Mark Lawrence via Python-ideas
On 03/04/2017 02:22, Neil Girdhar wrote: Same. One day, Python will have a decent parsing library. Nothing here https://wiki.python.org/moin/LanguageParsing suits your needs? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark

Re: [Python-ideas] "import me" to display some summary of the current python installation

2017-04-12 Thread Mark Lawrence via Python-ideas
On 12/04/2017 04:04, Steven D'Aprano wrote: On Tue, Apr 11, 2017 at 09:28:22PM -0500, Wes Turner wrote: python -m site https://github.com/python/cpython/blob/master/Lib/site.py - _script() Wes, I have no idea what that code snippet is supposed to do, or even whether it is supposed

Re: [Python-ideas] Augmented assignment syntax for objects.

2017-04-26 Thread Mark Lawrence via Python-ideas
, ask what you can do for our language. Mark Lawrence ___ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Allow function to return multiple values

2017-06-01 Thread Mark Lawrence via Python-ideas
where I needed and used such a functionality. I wish for this convenience in python so that I don't have to suffer going around a tuple. Can you explain how Go's multiple return values differ from Python's? Looking at the example here: https://golang.org/doc/effective_go.html i

Re: [Python-ideas] π = math.pi

2017-06-03 Thread Julien Palard via Python-ideas
ual numbers of characters in a line, but flake8 sees the correct python thrue flycheck so it reports errors properly, and you're still notified you're more than 80 columns long, even if visually there may be a longer valid line. Oh and it's also messing with copying and pasting to sh

[Python-ideas] Make functools.singledispatch register method return original function.

2017-06-17 Thread Mital Ashok via Python-ideas
used_elsewhere(arg, verbose=True): if verbose: print("Strength in numbers, eh?", end=" ") print(arg) fun.register(int)(used_elsewhere) But this goes against what a single-dispatch function is, so I think this is a minor enough use case to not worry about. __

Re: [Python-ideas] Bytecode JIT

2017-06-30 Thread Mark Lawrence via Python-ideas
at our language can do for you, ask what you can do for our language. Mark Lawrence --- This email has been checked for viruses by AVG. http://www.avg.com _______ Python-ideas mailing list [email protected] https://mail.python.org/mailman/lis

[Python-ideas] Add single() to itertools

2017-10-29 Thread Ivan Pozdeev via Python-ideas
a. https://stackoverflow.com/questions/46009985/get-contentcontrol-by-title-or-tag is the most recent occasion where I had this use case (that is not Python but the concept is language-agnostic). -- Regards, Ivan _______ Python-ideas ma

Re: [Python-ideas] Add single() to itertools

2017-10-30 Thread Ivan Pozdeev via Python-ideas
On 30.10.2017 9:29, [email protected] wrote: If I have understood your use-case, you have a function that returns a list of results (or possibly an iterator, or a tuple, or some other sequence): print(search(haystack, needle)) # prints ['bronze needle', &#

[Python-ideas] Add processor generation to wheel metadata

2017-10-30 Thread Ivan Pozdeev via Python-ideas
Generally, packages are compiled for the same processor generation as the corresponding Python. But not always -- e.g. NumPy opted for SSE2 even for Py2 to work around some compiler bug (https://github.com/numpy/numpy/issues/6428). I was bitten by that at an old machine once and found out that

Re: [Python-ideas] Add single() to itertools

2017-10-30 Thread Ivan Pozdeev via Python-ideas
On 30.10.2017 17:32, Guido van Rossum wrote: This is a key example of a case where code speaks. Can you write an implementation of how you would want single() to work in Python code? On Mon, Oct 30, 2017 at 2:49 AM, Ivan Pozdeev via Python-ideas mailto:[email protected]>>

Re: [Python-ideas] Python-ideas Digest, Vol 131, Issue 106

2017-10-30 Thread Ivan Pozdeev via Python-ideas
On 31.10.2017 8:37, [email protected] wrote: On Tue, Oct 31, 2017 at 3:50 PM, Ivan Pozdeev via Python-ideas wrote: On 30.10.2017 17:32, Guido van Rossum wrote: This is a key example of a case where code speaks. Can you write an implementation of how you would want single() to

Re: [Python-ideas] Looking for input to help with the pip situation

2017-11-06 Thread Ivan Pozdeev via Python-ideas
On 06.11.2017 9:47, Michel Desmoulin wrote: Hello, Today I'm going to give a training in Python again. And again it will go the same way. On Mac I will have to make people install python, then tell them to use pip3. On Windows, I will have to warn them about checking the "

Re: [Python-ideas] Looking for input to help with the pip situation

2017-11-06 Thread Ivan Pozdeev via Python-ideas
On 07.11.2017 1:48, Chris Barker wrote: On Mon, Nov 6, 2017 at 9:52 AM, Michel Desmoulin mailto:[email protected]>> wrote: I know and you still: - have to use py -m on windows, python3 linux, python in virtualenv... can't you use python3 -m pip install . ever

Re: [Python-ideas] Looking for input to help with the pip situation

2017-11-07 Thread Ivan Pozdeev via Python-ideas
sh/Ubuntu style environment leaves them at a disadvantage when they need to develop for actual Windows environments. Moreover, one of the key selling points of Python is that it can interface with anything and everything found in any environment! Rather than e.g. conjuring up a closed circle with own r

Re: [Python-ideas] Looking for input to help with the pip situation

2017-11-07 Thread Ivan Pozdeev via Python-ideas
e compiler (32/64 bits or ARM cross-compiler), and assorted environment variables set to the appropriate include/library directories. Could we do something similar for Python? I.e., Install under the "Python 3.6" start menu an additional "Python command prompt", which will sta

Re: [Python-ideas] Looking for input to help with the pip situation

2017-11-07 Thread Ivan Pozdeev via Python-ideas
On 07.11.2017 23:38, Chris Barker wrote: with ensurepip, having pip no installed in a python is getting less common, so maybe this isn't needed anymore, but pip is problematic in environments that have their own package manager (i.e. anything but bare Windows) because it doesn't

Re: [Python-ideas] Looking for input to help with the pip situation

2017-11-07 Thread Ivan Pozdeev via Python-ideas
absolutely! I really, really thought it did (I'm amazed I never heard from a single student getting bit by that...) On Windows, use py -X.Y to select the exact version of Python you want. Maybe Unix should have a launcher like this, too? It doesn't really need to be any more complex

[Python-ideas] Repurpose `assert' into a general-purpose check

2017-11-27 Thread Ivan Pozdeev via Python-ideas
The `assert' statment was created the same as in previous languages like C/C++: a check to only do in debug mode, when you can't yet trust your code to manage and pass around internal data correctly. Examples are array bounds and object state integrity constraints. Unlike C, Pytho

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2017-11-27 Thread Ivan Pozdeev via Python-ideas
On 28.11.2017 5:19, Chris Angelico wrote: Actually, Python does have a way of disabling assertions (the -O flag), so they should be treated the same way they are in C. Assertions should not be used as shorthands for "if cond: raise Exc" in the general case. I'm claiming, and pr

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2017-11-27 Thread Ivan Pozdeev via Python-ideas
On 28.11.2017 6:34, Ned Batchelder wrote: You are proposing:     assert condition, type, value Not specifically this, that's just an example. Actually, the way I'm using them,     assert condition, "error message", type would probably be the most expressive way. Why

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2017-11-27 Thread Ivan Pozdeev via Python-ideas
On 28.11.2017 8:59, Steven D'Aprano wrote: On Tue, Nov 28, 2017 at 07:35:45AM +0300, Ivan Pozdeev via Python-ideas wrote: Actually, the way I'm using them,     assert condition, "error message", type would probably be the most expressive way. I disagree that is exp

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2017-11-28 Thread Ivan Pozdeev via Python-ideas
results in two different interfaces. In normal mode, it enforces types while in -O, accepts anything that passes the duck test. Elazar בתאריך יום ג׳, 28 בנוב׳ 2017, 09:12, מאת Ivan Pozdeev via Python-ideas ‏mailto:[email protected]>>: On 28.11.2017 8:59, Steven D'Apran

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2017-11-28 Thread Ivan Pozdeev via Python-ideas
On 28.11.2017 16:36, Nick Coghlan wrote: On 28 November 2017 at 15:41, Steven D'Aprano wrote: On Tue, Nov 28, 2017 at 05:12:36AM +0300, Ivan Pozdeev via Python-ideas wrote: Unlike C, Python does the aforementioned checks all the time, i.e. it's effectively always in "debug mod

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2017-11-28 Thread Ivan Pozdeev via Python-ideas
On 28.11.2017 20:23, Ethan Furman wrote On 11/28/2017 08:03 AM, Ivan Pozdeev via Python-ideas wrote: On 28.11.2017 16:36, Nick Coghlan wrote:    it doesn't need to be a statement any more > Another benefit of a statement vs function is only evaluating the error-related argume

Re: [Python-ideas] Add a dict with the attribute access capability

2017-11-30 Thread Ivan Pozdeev via Python-ideas
ready was deprecated when the plistlib module was added to the regular stdlib in Python 2.6. This is a dict subclass which allows to access items as attributes. d = plistlib.Dict() d['a'] = 1 assert d.a == 1 d.b = 2 assert d['b'] == 2 Raymond noticed that that capability

Re: [Python-ideas] [Python-Dev] What's the status of PEP 505: None-aware operators?

2017-11-30 Thread Ivan Pozdeev via Python-ideas
On 29.11.2017 9:08, Steven D'Aprano wrote: On Tue, Nov 28, 2017 at 12:31:06PM -0800, Raymond Hettinger wrote: I also cc python-dev to see if anybody here is strongly in favor or against this inclusion. Put me down for a strong -1. The proposal would occasionally save a few keystoke

Re: [Python-ideas] Add a dict with the attribute access capability

2017-12-01 Thread Ivan Pozdeev via Python-ideas
On 01.12.2017 1:19, Greg Ewing wrote: Ivan Pozdeev via Python-ideas wrote: I needed to hold an external function reference in an object instance (if I assigned it to an attribute, it was converted into an instance method). No, that only happens to functions stored in *class* attributes

Re: [Python-ideas] Repr of lambda

2017-12-17 Thread Ivan Pozdeev via Python-ideas
signature and the expression of the lambda in its repr? >>> lambda x: x**2 It's the same for named functions:     In [1]: def ditto(a): return a     In [2]: ditto     Out[2]: Are you intending to do the same for them? This would return an old feature of Python 0.9.1 (ht

[Python-ideas] Allow to compile debug extension against release Python in Windows

2017-12-29 Thread Ivan Pozdeev via Python-ideas
g here at first. -- Regards, Ivan _______ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] [Python-Dev] subprocess not escaping "^" on Windows

2018-01-07 Thread Ivan Pozdeev via Python-ideas
On 07.01.2018 22:32, Christian Tismer wrote: Hi Chris, On 07.01.18 18:18, Chris Angelico wrote: Redirecting this part of the conversation to python-ideas. On Mon, Jan 8, 2018 at 3:17 AM, Christian Tismer wrote: As a side note: In most cases where shell=True is found, people seem to need

Re: [Python-ideas] Allow to compile debug extension against releasePython in Windows

2018-01-09 Thread Ivan Pozdeev via Python-ideas
otherwise it will work fine and the quoted code picks the release lib. Distutils' designers seem to have thought differently. Whether the extension is linked against pythonxx_d.lib is governed by the --debug switch to the `build' command rather than the type of the running Python

Re: [Python-ideas] Allow to compile debug extension against releasePython in Windows

2018-01-09 Thread Ivan Pozdeev via Python-ideas
On 09.01.2018 21:35, Ivan Pozdeev via Python-ideas wrote: On 08.01.2018 0:11, Steve Dower wrote: It’s not a good idea. You end up with two different C runtimes in memory that cannot communicate, and many things will not work properly. If you compile your debug build extension with the non

<    9   10   11   12   13   14   15   16   17   >