Re: A new feature request - parser add_mutually_exclusive_group - add a default value

2024-07-09 Thread אורי via Python-list
Thank you. Uri. אורי u...@speedy.net On Tue, Jul 9, 2024 at 6:40 PM Barry Scott wrote: > > > On 9 Jul 2024, at 06:13, ⁨אורי via Python-list⁩ <⁨python-list@python.org⁩> > wrote: > > I tried to subscribe to Python-ideas > > > These days ideas are discussed on https://discuss.python.org/ > It is

Re: A new feature request - parser add_mutually_exclusive_group - add a default value

2024-07-09 Thread Barry Scott via Python-list
> On 9 Jul 2024, at 06:13, ⁨אורי via Python-list⁩ <⁨python-list@python.org⁩> > wrote: > > I tried to subscribe to Python-ideas These days ideas are discussed on https://discuss.python.org/ It is rare to see an idea on the mailing list. Barry -- https://mail.python.org/mailman/listinfo/pyt

A new feature request - parser add_mutually_exclusive_group - add a default value

2024-07-08 Thread אורי via Python-list
Hi, Please look at this Stack Overflow post: https://stackoverflow.com/questions/78722378/parser-add-mutually-exclusive-group-how-can-i-set-a-default-value 1. Is there a way to add a default to parser add_mutually_exclusive_group groups - a value that will be set by default? In this case I want t

Re: Feature Request

2022-03-23 Thread Dennis Lee Bieber
On Wed, 23 Mar 2022 01:55:37 -0700 (PDT), Kazuya Ito declaimed the following: >Add "trun()" function to Python to truncate decimal part. You'll have to define what specific behavior you think is missing from the currently available functions? >>> plusover = 2.78 >>> plusunder = 3.14 >>>

Re: Feature Request

2022-03-23 Thread Michael F. Stemper
On 23/03/2022 03.55, Kazuya Ito wrote: Add "trun()" function to Python to truncate decimal part. Which of these should its behavior copy? from math import pi int(pi) 3 pi-int(pi) 0.14159265358979312 -- Michael F. Stemper This post contains greater than 95% post-consumer bytes by weight

Feature Request

2022-03-23 Thread Kazuya Ito
Add "trun()" function to Python to truncate decimal part. -- https://mail.python.org/mailman/listinfo/python-list

Python 3 Feature Request: `pathlib` Use Trailing Slash Flag

2020-08-09 Thread Adam Hendry
`pathlib` trims trailing slashes by default, but certain packages require trailing slashes. In particular, `cx_Freeze.bdist_msi` option "directories" is used to build the package directory structure of a program and requires trailing slashes. Does anyone think it would be a good idea to add a f

Feature request: method to cancel or bail out from fileinput.input(inplace=True)

2020-05-05 Thread Sparr Risher
After using https://docs.python.org/3/library/fileinput.html to open a file for inplace filtering, a backup is created before output is redirected to the new file. It is possible, but non-trivial and non-obvious, to bail out of this situation, putting the backed up file back in place and ending

Re: Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-28 Thread Cameron Simpson
ubdirectories, which might be useful but is usually misleading and on some OSes unsupported). So the programme should be pickier anyway. That all being said, I think I would like to put in a feature request for a non-blocking option. How should I go about doing so? I agree with the suggestion a

Re: Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-28 Thread Chris Angelico
e across, you probably need to check anyway. > That all being said, I think I would like to put in a feature request for a > non-blocking option. How should I go about doing so? Hmm, there are a few options. If you reckon it's pretty easy, you could just go straight to a GitHub pull

RE: Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-28 Thread Daniel Ojalvo via Python-list
diagnose. That all being said, I think I would like to put in a feature request for a non-blocking option. How should I go about doing so? Thanks again, Dan -Original Message- From: Chris Angelico Sent: Thursday, December 27, 2018 7:10 PM To: python-list@python.org Subject: Re: Undocume

Re: Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-28 Thread Chris Angelico
On Sat, Dec 29, 2018 at 4:24 AM Grant Edwards wrote: > > On 2018-12-27, Daniel Ojalvo via Python-list wrote: > > open("this_is_a_pipe") > > > > Opening a tty device can also block[1]. However, if somebody is using > the open() builtin on tty devices that's probably the least of their > prob

Re: Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-28 Thread Grant Edwards
On 2018-12-27, Daniel Ojalvo via Python-list wrote: open("this_is_a_pipe") > Opening a tty device can also block[1]. However, if somebody is using the open() builtin on tty devices that's probably the least of their problems. [1] Technically, opening any character-mode device could block

Re: Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-27 Thread Chris Angelico
kludge a solution. > Hmm. I disagree that the docs are deceptive here; I would normally expect open() to block if it needs to. But looking at this as a feature request, it seems reasonable. Actually, it's not even that hard to do, since open() is already pluggable: rosuav@sikorsky:~/t

Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-27 Thread Daniel Ojalvo via Python-list
os.open(, os.O_RDONLY| os.O_NONBLOCK) , mode='rb') as file_obj: I think this is mostly a documentation bug because this wouldn't be expected behavior to someone reading the docs, but open is behaving as the fifo man page<http://man7.org/linux/man-pages/man7/fifo.7.html> is docu

Re: Feature Request: Reposition Execution

2015-05-14 Thread Christian Gollwitzer
Am 15.05.15 um 05:58 schrieb Skybuck Flying: Thanks for the ideas, I haven't tried them yet. I wonder if they will work in a multi-threaded fashion. I doubt it. The run_script runs in it's own thread. It would be of enormous help if you would create a minimal script just like the above for

Re: Feature Request: Reposition Execution

2015-05-14 Thread Skybuck Flying
"Steven D'Aprano" wrote in message news:5553145b$0$9$c3e8...@news.astraweb.com... On Wednesday 13 May 2015 17:27, Christian Gollwitzer wrote: A clean way to exit your script could be to raise an exception. It should propagate to the toplevel and halt your script. However it is not poss

Re: Feature Request: Reposition Execution

2015-05-13 Thread Steven D'Aprano
On Wednesday 13 May 2015 17:27, Christian Gollwitzer wrote: > A clean way to exit your script could be to raise an exception. It > should propagate to the toplevel and halt your script. However it is not > possible to back and resume the execution. while True: try: run_script() # May

Re: Feature Request: Reposition Execution

2015-05-13 Thread Christian Gollwitzer
Am 12.05.15 um 22:18 schrieb Skybuck Flying: Thanks for suggestion, but I need a solution which can work in SikuliX as well. What the hell is that? Especially inside an observer handler that would be ideal. So far os.kill() is not supported in SikuliX as far as I can tell. OK a quick look

Re: Feature Request: Reposition Execution

2015-05-12 Thread Skybuck Flying
"Dave Angel" wrote in message news:mailman.354.1431345441.12865.python-l...@python.org... On 05/11/2015 07:46 AM, Skybuck Flying wrote: Hello, Sometimes it can be handy to "interrupt/reset/reposition" a running script. For example something externally goes badly wrong. " os.kill() then

Re: Feature Request: Reposition Execution

2015-05-11 Thread Grant Edwards
On 2015-05-11, Steven D'Aprano wrote: > On Mon, 11 May 2015 09:57 pm, Dave Angel wrote: > >> On 05/11/2015 07:46 AM, Skybuck Flying wrote: >>> Hello, >>> >>> Sometimes it can be handy to "interrupt/reset/reposition" a running >>> script. >>> >>> For example something externally goes badly wrong. >

Re: Feature Request: Reposition Execution

2015-05-11 Thread Dave Angel
On 05/11/2015 08:35 AM, Steven D'Aprano wrote: On Mon, 11 May 2015 09:57 pm, Dave Angel wrote: On 05/11/2015 07:46 AM, Skybuck Flying wrote: Hello, Sometimes it can be handy to "interrupt/reset/reposition" a running script. For example something externally goes badly wrong. os.kill() the

Re: Feature Request: Reposition Execution

2015-05-11 Thread Steven D'Aprano
On Mon, 11 May 2015 09:57 pm, Dave Angel wrote: > On 05/11/2015 07:46 AM, Skybuck Flying wrote: >> Hello, >> >> Sometimes it can be handy to "interrupt/reset/reposition" a running >> script. >> >> For example something externally goes badly wrong. >> > > os.kill() > > then in your process, handl

Re: Feature Request: Reposition Execution

2015-05-11 Thread Marko Rauhamaa
Dave Angel : > On 05/11/2015 07:46 AM, Skybuck Flying wrote: >> Hello, >> >> Sometimes it can be handy to "interrupt/reset/reposition" a running script. >> For example something externally goes badly wrong. > > os.kill() > > then in your process, handle the exception, and do whatever you think > i

Re: Feature Request: Reposition Execution

2015-05-11 Thread Dave Angel
On 05/11/2015 07:46 AM, Skybuck Flying wrote: Hello, Sometimes it can be handy to "interrupt/reset/reposition" a running script. For example something externally goes badly wrong. os.kill() then in your process, handle the exception, and do whatever you think is worthwhile. -- DaveA -

Feature Request: Reposition Execution

2015-05-11 Thread Skybuck Flying
Hello, Sometimes it can be handy to "interrupt/reset/reposition" a running script. For example something externally goes badly wrong. The script is unaware of this. Current solution would require to have an "Abort" boolean everywhere. The abort boolean could then be set to True to indicate al

Re: idle feature request

2015-02-11 Thread Terry Reedy
On 2/11/2015 9:48 PM, Rustom Mody wrote: On Thursday, February 12, 2015 at 7:57:48 AM UTC+5:30, Terry Reedy wrote: If one saves the shell with 'save as', the filename is added to the title bar. If one does something more, the name in bracketed with *s to indicate the the memory buffer has bee

Re: idle feature request

2015-02-11 Thread Mark Lawrence
On 12/02/2015 02:48, Rustom Mody wrote: [BTW I have some other feature requests too. Is this the best forum to talk of them? And thanks for your work on idle :-) ] Here is as good a place as any although there is an IDLE development mailing list at https://mail.python.org/mailman/listinfo/i

Re: idle feature request

2015-02-11 Thread Chris Angelico
On Thu, Feb 12, 2015 at 1:27 PM, Terry Reedy wrote: > However, when one quits, then, unlike a regular edit window, there is no > ask-to-save warning. Is this what you want? This would seem reasonable and > likely easy. (I would, however, not want the prompt when the buffer has not > been saved

Re: idle feature request

2015-02-11 Thread Rustom Mody
On Thursday, February 12, 2015 at 7:57:48 AM UTC+5:30, Terry Reedy wrote: > On 2/11/2015 1:00 PM, Mark Lawrence wrote: > > On 11/02/2015 13:11, Rustom Mody wrote: > >> Context: > >> I am using idle for taking python classes. > > Teaching or taking? Teaching -- I would like to mail¹ students the i

Re: idle feature request

2015-02-11 Thread Terry Reedy
On 2/11/2015 1:00 PM, Mark Lawrence wrote: On 11/02/2015 13:11, Rustom Mody wrote: Context: I am using idle for taking python classes. Teaching or taking? Finish the class and run out usually in a hurry and forget to save the idle interaction window. Do you mean the shell window? Would l

Re: idle feature request

2015-02-11 Thread Mark Lawrence
On 11/02/2015 13:11, Rustom Mody wrote: Context: I am using idle for taking python classes. Finish the class and run out usually in a hurry and forget to save the idle interaction window. Would like to save it so that I can mail it to the students. In emacs I could set a hook to make arbitrary

Re: idle feature request

2015-02-11 Thread Fabien
On 11.02.2015 14:29, Rustom Mody wrote: So getting up and running with minimal headache is an important priority. Yes true. I consider Notebooks as a way to do "frontal" teaching, not necessarily usefull if students have to redo what you are doing on screen. For that, notebooks are rather pro

Re: idle feature request

2015-02-11 Thread Rustom Mody
On Wednesday, February 11, 2015 at 6:50:35 PM UTC+5:30, Fabien wrote: > On 11.02.2015 14:11, Rustom Mody wrote: > > Context: > > I am using idle for taking python classes. > > I know this is not your question, but: have you considered using iPython > notebooks for teaching? They save automaticall

Re: idle feature request

2015-02-11 Thread Fabien
On 11.02.2015 14:11, Rustom Mody wrote: Context: I am using idle for taking python classes. I know this is not your question, but: have you considered using iPython notebooks for teaching? They save automatically, look nice, and can be sent as code, html, rst, ... Fabien -- https://mail.py

idle feature request

2015-02-11 Thread Rustom Mody
Context: I am using idle for taking python classes. Finish the class and run out usually in a hurry and forget to save the idle interaction window. Would like to save it so that I can mail it to the students. In emacs I could set a hook to make arbitrary 'buffers' like the python-idle shell be

Re: argparse feature request

2013-11-22 Thread Robert Kern
On 2013-11-22 18:15, Neal Becker wrote: Robert Kern wrote: On 2013-11-22 16:52, Neal Becker wrote: Robert Kern wrote: On 2013-11-22 14:56, Neal Becker wrote: I use arparse all the time and find it serves my needs well. One thing I'd like to see. In the help message, I'd like to automatica

Re: argparse feature request

2013-11-22 Thread Neal Becker
Robert Kern wrote: > On 2013-11-22 16:52, Neal Becker wrote: >> Robert Kern wrote: >> >>> On 2013-11-22 14:56, Neal Becker wrote: I use arparse all the time and find it serves my needs well. One thing I'd like to see. In the help message, I'd like to automatically add the default

Re: argparse feature request

2013-11-22 Thread Robert Kern
On 2013-11-22 16:52, Neal Becker wrote: Robert Kern wrote: On 2013-11-22 14:56, Neal Becker wrote: I use arparse all the time and find it serves my needs well. One thing I'd like to see. In the help message, I'd like to automatically add the default values. What I'd like to see is: --siz

Re: argparse feature request

2013-11-22 Thread Neal Becker
Robert Kern wrote: > On 2013-11-22 14:56, Neal Becker wrote: >> I use arparse all the time and find it serves my needs well. One thing I'd >> like >> to see. In the help message, I'd like to automatically add the default >> values. >> >> For example, here's one of my programs: >> >> python3 te

Re: argparse feature request

2013-11-22 Thread Robert Kern
On 2013-11-22 14:56, Neal Becker wrote: I use arparse all the time and find it serves my needs well. One thing I'd like to see. In the help message, I'd like to automatically add the default values. For example, here's one of my programs: python3 test_freq3.py --help usage: test_freq3.py [-

argparse feature request

2013-11-22 Thread Neal Becker
I use arparse all the time and find it serves my needs well. One thing I'd like to see. In the help message, I'd like to automatically add the default values. For example, here's one of my programs: python3 test_freq3.py --help usage: test_freq3.py [-h] [--size SIZE] [--esnodB ESNODB] [--tau

Re: Feature Request: `operator.not_in`

2013-04-19 Thread Matthew Gilson
On 4/19/13 2:27 PM, Terry Jan Reedy wrote: On 4/19/2013 10:27 AM, Matthew Gilson wrote: ) It seems to me that the operator module should have a `not_in` or `not_contains` function. It seems asymmetric that there exists a `is_not` function which implements `x is not y` but there isn't a functio

Re: Feature Request: `operator.not_in`

2013-04-19 Thread Terry Jan Reedy
On 4/19/2013 10:27 AM, Matthew Gilson wrote: ) It seems to me that the operator module should have a `not_in` or `not_contains` function. It seems asymmetric that there exists a `is_not` function which implements `x is not y` but there isn't a function to represent `x not in y`. There is also

Feature Request: `operator.not_in`

2013-04-19 Thread Matthew Gilson
I believe that I read somewhere that this is the place to start discussions on feature requests, etc. Please let me know if this isn't the appropriate venue (and what the appropriate venue would be if you know). This request has 2 related parts, but I think they can be considered seperately:

Re: [Bug / Feature Request] IDLE Shell

2011-04-12 Thread James Mills
On Wed, Apr 13, 2011 at 11:50 AM, rantingrick wrote: > In the IDLE shell when pressing the key combos "Control+Up" and > "Control+Down" the insertion cursor should jump to the nearest prompt > (>>>) above or below it's current position respectively. > > Note: In the Editor Window of IDLE the curre

[Bug / Feature Request] IDLE Shell

2011-04-12 Thread rantingrick
Hello folks, In the IDLE shell when pressing the key combos "Control+Up" and "Control+Down" the insertion cursor should jump to the nearest prompt (>>>) above or below it's current position respectively. Note: In the Editor Window of IDLE the current behavior is for the insertion cursor to jump

Re: [Feature Request] dict.setdefault()

2011-04-11 Thread Tim Chase
On 04/11/2011 05:44 PM, Chris Angelico wrote: On Tue, Apr 12, 2011 at 8:41 AM, MRAB wrote: I'm not sure that "setdefault" should take **kw args for this because of its existing argument structure (key + optional value). A new method like "updatedefault" may be better, IMHO. It would act like "

Re: [Feature Request] dict.setdefault()

2011-04-11 Thread MRAB
On 11/04/2011 23:44, Chris Angelico wrote: On Tue, Apr 12, 2011 at 8:41 AM, MRAB wrote: I'm not sure that "setdefault" should take **kw args for this because of its existing argument structure (key + optional value). A new method like "updatedefault" may be better, IMHO. It would act like "upd

Re: [Feature Request] dict.setdefault()

2011-04-11 Thread Chris Rebert
On Mon, Apr 11, 2011 at 2:35 PM, rantingrick wrote: > > setdefault should take **kw args in the case of needing to set > multiple defaults at one time. I would even settle for an *arg list if > i had to. What would the return value be? dict.setdefault() doesn't currently just return None you know

Re: [Feature Request] dict.setdefault()

2011-04-11 Thread Chris Angelico
On Tue, Apr 12, 2011 at 8:41 AM, MRAB wrote: > I'm not sure that "setdefault" should take **kw args for this because > of its existing argument structure (key + optional value). > > A new method like "updatedefault" may be better, IMHO. It would act > like "update" except that it wouldn't overwrit

Re: [Feature Request] dict.setdefault()

2011-04-11 Thread MRAB
On 11/04/2011 23:16, Westley Martínez wrote: On Mon, 2011-04-11 at 14:35 -0700, rantingrick wrote: setdefault should take **kw args in the case of needing to set multiple defaults at one time. I would even settle for an *arg list if i had to. Anything is better than... d.setdefault(blah, blah)

Re: [Feature Request] dict.setdefault()

2011-04-11 Thread Westley Martínez
On Mon, 2011-04-11 at 14:35 -0700, rantingrick wrote: > setdefault should take **kw args in the case of needing to set > multiple defaults at one time. I would even settle for an *arg list if > i had to. Anything is better than... > > d.setdefault(blah, blah) > d.setdefault(blah, blah) > d.setdefa

[Feature Request] dict.setdefault()

2011-04-11 Thread rantingrick
setdefault should take **kw args in the case of needing to set multiple defaults at one time. I would even settle for an *arg list if i had to. Anything is better than... d.setdefault(blah, blah) d.setdefault(blah, blah) d.setdefault(blah, blah) d.setdefault(blah, blah) if blah is not blah: d

Re: feature request: string.contains('...')

2010-09-24 Thread John Posner
On 9/24/2010 2:45 PM, Tim Chase wrote: On 09/24/10 13:01, Ethan Furman wrote: John Posner wrote: Another "missing feature" candidate: sublist >>> 'bc' in 'abcde' True >>> list('bc') in list('abcde') False I'm not aware of any idioms, but how about a simple function? Foldable into a one

Re: feature request: string.contains('...')

2010-09-24 Thread Tim Chase
On 09/24/10 13:01, Ethan Furman wrote: John Posner wrote: Another "missing feature" candidate: sublist >>> 'bc' in 'abcde' True >>> list('bc') in list('abcde') False I'm not aware of any idioms, but how about a simple function? def listinlist(list1, list2): "checks if

Re: feature request: string.contains('...')

2010-09-24 Thread Ethan Furman
John Posner wrote: Another "missing feature" candidate: sublist >>> 'bc' in 'abcde' True >>> list('bc') in list('abcde') False I'm not aware of any idioms, but how about a simple function? def listinlist(list1, list2): "checks if list1 is in list2" if not list1: re

Re: feature request: string.contains('...')

2010-09-24 Thread John Posner
On 9/24/2010 4:21 AM, Peter Otten wrote: If you are not interested in the position of the substr use the "in" operator: if substr in s: print "found" else: print "not found" Another "missing feature" candidate: sublist >>> 'bc' in 'abcde' True >>> list('bc') in list('abc

Re: feature request: string.contains('...')

2010-09-24 Thread Wolfgang Rohdewald
On Freitag 24 September 2010, Wim Feijen wrote: > would really like having a string.contains('...') function > which returns either True or False. I know I can mimick this > behaviour by saying string.find('...') != -1 , however, I > find this harder to read. >>> a = 'xy134' >>> '13' in a True >>

Re: feature request: string.contains('...')

2010-09-24 Thread Peter Otten
Wim Feijen wrote: > I was wondering, how to make a feature request? You can post suggestions to improve python on the python-ideas mailing list or make feature requests on the bugtracker at bugs.python.org > I would really like having a string.contains('...') function which

feature request: string.contains('...')

2010-09-24 Thread Wim Feijen
Hello, I was wondering, how to make a feature request? I would really like having a string.contains('...') function which returns either True or False. I know I can mimick this behaviour by saying string.find('...') != -1 , however, I find this harder to read. string.conta

Re: feature request for a wget -r like implementation in python3

2010-04-18 Thread gert
On Apr 17, 1:14 am, "Gabriel Genellina" wrote: > En Thu, 15 Apr 2010 16:37:37 -0300, gert escribió: > > > [a wget -r like implementation in python3] > > So I can make a recursive http download script > > What about calling wget itself? subprocess.call(['wget',...]) > The only dependency I would

Re: feature request for a wget -r like implementation in python3

2010-04-18 Thread gert
On Apr 16, 3:41 am, alex23 wrote: > On Apr 16, 5:37 am, gert wrote: > > > So I can make a recursive http download script > > My goal is a one click instruction to install and launch my > > projecthttp://code.google.com/p/appwsgi/ > > Here's Guido's take on wget: > >     import sys, urllib >    

Re: feature request for a wget -r like implementation in python3

2010-04-16 Thread Gabriel Genellina
En Thu, 15 Apr 2010 16:37:37 -0300, gert escribió: [a wget -r like implementation in python3] So I can make a recursive http download script What about calling wget itself? subprocess.call(['wget',...]) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: feature request for a wget -r like implementation in python3

2010-04-15 Thread alex23
On Apr 16, 5:37 am, gert wrote: > So I can make a recursive http download script > My goal is a one click instruction to install and launch my > projecthttp://code.google.com/p/appwsgi/ Here's Guido's take on wget: import sys, urllib def reporthook(*a): print a for url in sys.argv[1

feature request for a wget -r like implementation in python3

2010-04-15 Thread gert
So I can make a recursive http download script My goal is a one click instruction to install and launch my project http://code.google.com/p/appwsgi/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature request: String-inferred names

2009-12-04 Thread Bruno Desthuilliers
Brad Harms a écrit : On Fri, 04 Dec 2009 18:05:03 +1100, Ben Finney wrote: (snip) 2.) Attributes whose values are determined or assigned dynamically by indirectly calling a function (like properties and instancemethods) Yes, the term “property” seems to do what you want. I wasn't asking what

Re: Feature request: String-inferred names

2009-12-04 Thread Bruno Desthuilliers
Ben Finney a écrit : Brad Harms writes: (snip) 2.) Attributes whose values are determined or assigned dynamically by indirectly calling a function (like properties and instancemethods) Yes, the term “property” seems to do what you want. The property type is just one possible application o

Re: Feature request: String-inferred names

2009-12-04 Thread Bruno Desthuilliers
Brad Harms a écrit : On Tue, 2009-12-01 at 16:58 +0100, Bruno Desthuilliers wrote: The Music Guy a écrit : (snip) Lie Ryan, I think I see what you're saying about using __dict__ to add members No "members" in Python - only attributes. to a class, but it's not quite the same. __dict__ is onl

Re: Feature request: String-inferred names

2009-12-04 Thread Steven D'Aprano
On Thu, 03 Dec 2009 23:12:39 -0600, Brad Harms wrote: > On Tue, 2009-12-01 at 14:38 +, Steven D'Aprano wrote: [...] >> It's just special double-underscore methods like __init__ __add__ etc >> that have to be in the class rather than the instance. (To be precise, >> you can add such a method to

Re: Feature request: String-inferred names

2009-12-04 Thread Brad Harms
On Fri, 04 Dec 2009 09:00:42 +, Steven D'Aprano wrote: > Not all such attributes are actually found in instance.__dict__. ...I hadn't even considered __slots__ yet. Hm... > Or dynamic attributes returned by __getattr__ or __getattribute__. I'm looking for a generic term, because it's too cum

Re: Feature request: String-inferred names

2009-12-04 Thread Brad Harms
On Fri, 04 Dec 2009 18:05:03 +1100, Ben Finney wrote: > Brad Harms writes: > >> Anyway, it looks like the docs agree with you >> (http://docs.python.org/glossary.html#term-attribute), so I'm not going >> to argue. > > That's good, because the terms are quite well established in Python > termino

Re: Feature request: String-inferred names

2009-12-04 Thread Steven D'Aprano
On Fri, 04 Dec 2009 18:05:03 +1100, Ben Finney wrote: > Brad Harms writes: ... >> 1.) "Regular" attributes, ie. those that are shortcuts to items in the >> directly associated object's __dict__, > > I don't know what you mean by “shortcuts to items”. The names are looked > up in dictionaries; wh

Re: Feature request: String-inferred names

2009-12-03 Thread Ben Finney
Brad Harms writes: > Anyway, it looks like the docs agree with you > (http://docs.python.org/glossary.html#term-attribute), so I'm not > going to argue. That's good, because the terms are quite well established in Python terminology. > However, for the purpose of clean communication, I'd still

Re: Feature request: String-inferred names

2009-12-03 Thread Bradley K. Harms
On Tue, 2009-12-01 at 14:38 +, Steven D'Aprano wrote: > On Mon, 30 Nov 2009 18:55:46 -0800, The Music Guy wrote: > > > Lie Ryan, I think I see what you're saying about using __dict__ to add > > members to a class, but it's not quite the same. __dict__ is only for > > attributes, NOT properties

Re: Feature request: String-inferred names

2009-12-03 Thread Brad Harms
On Tue, 2009-12-01 at 16:58 +0100, Bruno Desthuilliers wrote: > The Music Guy a écrit : > (snip) > > Lie Ryan, I think I see what you're saying about using __dict__ to add > > members > > No "members" in Python - only attributes. > > to a class, but it's not quite the same. __dict__ is only for >

Re: Feature request: String-inferred names

2009-12-03 Thread Brad Harms
On Tue, 2009-12-01 at 14:38 +, Steven D'Aprano wrote: > On Mon, 30 Nov 2009 18:55:46 -0800, The Music Guy wrote: > > > Lie Ryan, I think I see what you're saying about using __dict__ to add > > members to a class, but it's not quite the same. __dict__ is only for > > attributes, NOT properties

Re: Feature request: String-inferred names

2009-12-01 Thread Carl Banks
On Dec 1, 10:21 am, Raymond Hettinger wrote: > [Gregory Ewing] > > > >>I just posted to my blog about a feature that I'd like to see added to > > >>Python. > > > >>http://alphaios.blogspot.com/2009/11/python-string-inferred-names-wor... > > > I don't think getattr and setattr are used anywhere nea

Re: Feature request: String-inferred names

2009-12-01 Thread Raymond Hettinger
[Gregory Ewing] > >>I just posted to my blog about a feature that I'd like to see added to > >>Python. > > >>http://alphaios.blogspot.com/2009/11/python-string-inferred-names-wor... > > I don't think getattr and setattr are used anywhere near > frequently enough to justify special syntax. Perhaps

Re: Feature request: String-inferred names

2009-12-01 Thread Bruno Desthuilliers
The Music Guy a écrit : (snip) Lie Ryan, I think I see what you're saying about using __dict__ to add members No "members" in Python - only attributes. to a class, but it's not quite the same. __dict__ is only for attributes, NOT properties, methods, etc. which all come from the class of an o

Re: Feature request: String-inferred names

2009-12-01 Thread Steven D'Aprano
On Mon, 30 Nov 2009 18:55:46 -0800, The Music Guy wrote: > Lie Ryan, I think I see what you're saying about using __dict__ to add > members to a class, but it's not quite the same. __dict__ is only for > attributes, NOT properties, methods, etc. which all come from the class > of an object rather

Re: Feature request: String-inferred names

2009-11-30 Thread The Music Guy
> Brad Harms FearsomeDragonfly at gmail.com > Mon Nov 30 05:04:37 CET 2009 > > That was a relatively simple example; classes as simple as the ones > generated by the It is more likely that the class generation could would > appear in a metaclass's class constructor or decorator function, and there

Re: Feature request: String-inferred names

2009-11-30 Thread Terry Reedy
Brad Harms wrote: Well, yes, the names would have to be determined at run time. That's what getattr and setattr do, except that that do it in the context of an object rather than the local scope. However, I was under the impression that python's mechanism for looking up local names was the sam

Re: Feature request: String-inferred names

2009-11-30 Thread Lie Ryan
On 12/1/2009 3:35 AM, Bruno Desthuilliers wrote: Lie Ryan a écrit : On 11/28/2009 3:08 PM, The Music Guy wrote: (snip the part about the proposed feature - which I don't like but that's not the point) My projects rely on a lot of metaclassing for the automatic generation of properties and me

Re: Feature request: String-inferred names

2009-11-30 Thread Bruno Desthuilliers
Lie Ryan a écrit : On 11/28/2009 3:08 PM, The Music Guy wrote: (snip the part about the proposed feature - which I don't like but that's not the point) My projects rely on a lot of metaclassing for the automatic generation of properties and methods, which saves tremendous amounts of coding.

Re: Feature request: String-inferred names

2009-11-30 Thread The Music Guy
P.S., not trying to start a flame war. It's just that I can't stand to keep silent on the matter any longer. -- Brad Harms -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature request: String-inferred names

2009-11-30 Thread Ben Finney
Cameron Simpson writes: > The Zen promotes the guideline that there should be only one (obvious) > way to do most things and that's a surprisingly effective design rule. It's also important to realise that the Zen places the “preferably only one” in a parenthetical, and note that “preferably” qu

Re: Feature request: String-inferred names

2009-11-30 Thread Bruno Desthuilliers
Lie Ryan a écrit : (snip) > setattr, getattr, and delattr are already sugar for accessing instance.__dict__. They are actually much more than that - else descriptors and inheritance wouldn't work. -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature request: String-inferred names

2009-11-29 Thread The Music Guy
On Sun, Nov 29, 2009 at 11:01 PM, Brad Harms wrote: > > May the Penguin in the sky bless your every subroutine, > Um...feel free to ignore that. >_> -- Brad Harms -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature request: String-inferred names

2009-11-29 Thread Brad Harms
On Sun, Nov 29, 2009 at 9:59 PM, Carl Banks wrote: > Another thing that can be determined through common sense is that if > you have object that you are calling getattr and setattr on so much > that you think you need special syntax, you should have been using a > dict. > (Re-send; original was s

Re: Feature request: String-inferred names

2009-11-29 Thread Brad Harms
On Sun, Nov 29, 2009 at 7:49 PM, Lie Ryan wrote: > On 11/29/2009 12:22 PM, The Music Guy wrote: > >> When I first started seeing @ show up in Python code, I said "what the >> heck is that? It looks so weird and _ugly_.I would never try to mess >> with that." But I started seeing it more and more,

Re: Feature request: String-inferred names

2009-11-29 Thread Carl Banks
On Nov 28, 3:38 am, The Music Guy wrote: > On Nov 28, 3:07 am, Lie Ryan wrote: > > If you use it a lot, it is likely 1) you have abused class syntax for > > what should have been a dict or 2) what you need is to override > > __getattr__/__getattribute__ and __setattr__ > > Oh boy...here we go. :|

Re: Feature request: String-inferred names

2009-11-29 Thread Carl Banks
On Nov 26, 3:43 pm, The Music Guy wrote: > That aside, I still feel that a new syntax would be a better solution > than a new class. And, anyway, what I'm proposing isn't *quite* the > same as what Ben North proposed. Ben's idea was *strictly* to create > shorthand syntax to the getattr/setattr/de

Re: Feature request: String-inferred names

2009-11-29 Thread Lie Ryan
On 11/29/2009 12:22 PM, The Music Guy wrote: When I first started seeing @ show up in Python code, I said "what the heck is that? It looks so weird and _ugly_.I would never try to mess with that." But I started seeing it more and more, so I asked #python what it was. They told me about decorators

Re: Feature request: String-inferred names

2009-11-29 Thread Terry Reedy
The Music Guy wrote: When I first started seeing @ show up in Python code, I said "what the heck is that? For future reference, PySymbols.html at http://code.google.com/p/xploro/downloads/list answers all such symbol questions. -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature request: String-inferred names

2009-11-29 Thread David Robinow
On Sun, Nov 29, 2009 at 6:58 AM, inhahe wrote: > Did you say you were using gmail to post?  I think mailing lists tend to > have issues with gmail because it puts html in the message or something like > that.  Btw I recently set up this mailing list to send me a message back > when I successfully

Re: Feature request: String-inferred names

2009-11-29 Thread inhahe
On Sun, Nov 29, 2009 at 5:15 AM, The Music Guy wrote: > Okay, I'm having a really hard time telling which messages are getting > on to the list and which ones aren't. Some of the messages I send show > up in the comp.lang.python mirror in Google Groups, and some aren't. > Others show up on the Gro

Re: Feature request: String-inferred names

2009-11-29 Thread The Music Guy
Okay, I'm having a really hard time telling which messages are getting on to the list and which ones aren't. Some of the messages I send show up in the comp.lang.python mirror in Google Groups, and some aren't. Others show up on the Groups mirror, but don't show up in Gmail, or show up in a differe

Re: Feature request: String-inferred names

2009-11-29 Thread The Music Guy
> > On Sat, Nov 28, 2009 at 9:39 PM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > > Removing code redundancy is all very well, but beware of turning into an > >> architecture astronaut: > >> > http://www.joelonsoftware.com/articles/fog18.html > >> > There is such a thin

Re: Feature request: String-inferred names

2009-11-28 Thread inhahe
i like this idea (i posted some thoughts on it in the blog, but it's not approved yet as of this writing) in short, i suggested extending the idea to make it more a) generalized, b) simple, c) intuitive, and d) flexible. so instead of just using $ for attributes, you could use it anywhere you def

  1   2   3   >