Re: [Python-Dev] Arbitrary non-identifier string keys when using **kwargs

2018-10-12 Thread Samuele Pedroni
On Thu, Oct 4, 2018 at 10:58 AM Steven D'Aprano wrote: > While keyword arguments have to be identifiers, using **kwargs allows > arbitrary strings which aren't identifiers: > > py> def spam(**kwargs): > ... print(kwargs) > ... > py> spam(**{"something arbitrary": 1, '\n': 2}) > {'something ar

Re: [Python-Dev] Challenge: Please break this! [Now with blog post]

2009-02-28 Thread Samuele Pedroni
Guido van Rossum wrote: On Mon, Feb 23, 2009 at 3:16 PM, "Martin v. Löwis" wrote: Don't I remember the previous restricted module dying a similar "death of 1,000 cuts" before it was concluded to be unsafe at any height and abandoned? I think you are slightly misremembering. It got cu

Re: [Python-Dev] Reviving restricted mode?

2009-02-22 Thread Samuele Pedroni
Guido van Rossum wrote: I've received some enthusiastic emails from someone who wants to revive restricted mode. He started out with a bunch of patches to the CPython runtime using ctypes, which he attached to an App Engine bug: http://code.google.com/p/googleappengine/issues/detail?id=671 Base

Re: [Python-Dev] To 3.0.2 or not to 3.0.2?

2009-02-17 Thread Samuele Pedroni
Victor Stinner wrote: Le Tuesday 17 February 2009 08:52:20 Lennart Regebro, vous avez écrit : On Tue, Feb 17, 2009 at 00:50, Guido van Rossum wrote: Can you explain the difficulty with porting setuptools in more detail? Oh, it just exposes a bug in distutils. It probably means

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-03 Thread Samuele Pedroni
Nick Coghlan wrote: Samuele Pedroni wrote: I found only an example in my personal recent code: START = "" END = "" TITLEPATTERN = lambda s: "%s" % s this three are later used in a very few .find() and .replace() expressions in the same module. I suppose my p

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-03 Thread Samuele Pedroni
Terry Reedy wrote: Some people write somename = lambda args: expression instead of the more obvious (to most people) and, dare I say, standard def somename(args): return expression The difference in the result (the only one I know of) is that the code and function objects get the generi

[Python-Dev] pypy-0.99.0: new object spaces, optimizations, configuration ...

2007-02-17 Thread Samuele Pedroni
PyPy team, Samuele Pedroni, Carl Friedrich Bolz, Armin Rigo, Michael Hudson, Maciej Fijalkowski, Anders Chrigstroem, Holger Krekel, Guido Wesdorp and many others: http://codespeak.net/pypy/dist/pypy/doc/contributor.html What is PyPy? Techni

Re: [Python-Dev] Fwd: survey about the use of agile practices

2006-12-24 Thread Samuele Pedroni
Aahz wrote: > On Sun, Dec 24, 2006, Guido van Rossum wrote: > >> Anyone? >> > > It was discarded as probable spam by me due to the lack of a valid "To:" > line. Do you have any particular reason for believing that it's real? > http://agile.diee.unica.it/uras.html (it's in italian) seem

Re: [Python-Dev] Using SCons for cross-compilation

2006-11-09 Thread Samuele Pedroni
Barry Warsaw wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Nov 9, 2006, at 2:15 PM, [EMAIL PROTECTED] wrote: > > >> Martin> In any case, the patch being contributed uses SCons. If >> people >> Martin> think this is unmaintainable, this is a reason to >> reject the >

Re: [Python-Dev] Import semantics

2006-07-06 Thread Samuele Pedroni
leave it as it is for java packages seems a reasonable compromise. > > >>Also, I just realized that you're the new Jython maintainer. Is *that* >>official? > > It is official, at least in the unofficial way that Jython appears to > work: Brian handed the

Re: [Python-Dev] doc for new restricted execution design for Python

2006-07-01 Thread Samuele Pedroni
Brett Cannon wrote: > > I don't know how JavaScript is doing it yet. The critical thing for me > for this month was trying to come up with a security model. > > And if you don't think it is going to scale, how do you think it should > be done? if I remember correctly, the boundary/granularity

Re: [Python-Dev] Import semantics

2006-06-12 Thread Samuele Pedroni
Bill Janssen wrote: >>the difference in Jython is deliberate. I think the reason was to mimic >>more the Java style for this, in java fully qualified names always work. >>In jython importing the top level packages is enough to get a similar >>effect. >> >>This is unlikely to change for backward

Re: [Python-Dev] Import semantics

2006-06-12 Thread Samuele Pedroni
Fabio Zadrozny wrote: > Python and Jython import semantics differ on how sub-packages should be > accessed after importing some module: > > Jython 2.1 on java1.5.0 (JIT: null) > Type "copyright", "credits" or "license" for more information. > >>> import xml > >>> xml.dom > > > Python 2.4.2 (#

[Python-Dev] Reminder: call for proposals "Python Language and Libraries Track" for Europython 2006

2006-05-18 Thread Samuele Pedroni
uot;"" The full call and submission links are at: http://www.europython.org/sections/tracks_and_talks/call-for-proposals Samuele Pedroni, Python Language and Libraries Track Chair ___ Python-Dev mailing list Python-Dev@python.org http://mail

[Python-Dev] Reminder: call for proposals "Python Language and Libraries Track" for Europython 2006

2006-05-02 Thread Samuele Pedroni
submission links are at: http://www.europython.org/sections/tracks_and_talks/call-for-proposals Thanks, Samuele Pedroni ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.

Re: [Python-Dev] Class decorators

2006-03-28 Thread Samuele Pedroni
Mike Krell wrote: >Greg Ewing canterbury.ac.nz> writes: > > > >>I've just been playing around with metaclasses, and >>I think I've stumbled across a reason for having >>class decorators as an alternative to metaclasses >>for some purposes. >> >> > >There has also been discussion on the Iron

[Python-Dev] Next PyPy Sprint: Tokyo 23/4 - 29/4

2006-03-27 Thread Samuele Pedroni
Tokyo PyPy Sprint: 23rd - 29th April 2006 The next PyPy sprint is scheduled to take place 23rd- 29th April 2006 (Sunday-Saturday) in Akihabara, Tokyo, Japan. We will together with FSIJ (Free Software Initiative of Japan) aim to promote P

Re: [Python-Dev] GeneratorExit inheriting from Exception

2006-03-18 Thread Samuele Pedroni
Barry Warsaw wrote: > On Sat, 2006-03-18 at 22:53 +1000, Nick Coghlan wrote: > >>Should GeneratorExit inherit from Exception or BaseException? > > > Actually, this prompts me to write about an issue I have with PEP 352. > I actually don't think it's necessary (yes, I know it's already in the > t

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Samuele Pedroni
Raymond Hettinger wrote: > [Samuele Pedroni] > >> there's no sys.checkinterval in Jython. Implementing this would need the >> introduction of some kind of GIL implementation in Jython, the JVM >> has no primitive for global critical sections. > > > Wo

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-13 Thread Samuele Pedroni
Raymond Hettinger wrote: >>it doesn't translate reasonably to Jython or IronPython, it's really tricky >>to >>implement, > > > FWIW, someone on the newsgroup suggested implementing this via a slight > modification to sys.checkinterval(). The idea was that a None argument would > translate to

Re: [Python-Dev] Making builtins more efficient

2006-03-13 Thread Samuele Pedroni
Phillip J. Eby wrote: > At 02:47 PM 3/13/2006 -0500, Jim Jewett wrote: > >>Paul Moore wrote: >> >> >>>Is there any practical way of detecting and flagging >>>constructs like the above (remotely shadowing a >>>builtin in another module)? >> >>Phillip J. Eby wrote: >> >>>the patch ended up being bac

Re: [Python-Dev] PEP for Better Control of Nested Lexical Scopes

2006-02-22 Thread Samuele Pedroni
Greg Ewing wrote: > Jeremy Hylton wrote: > > >>The names of naming statements are quite hard to get right, I fear. > > > My vote goes for 'outer'. > > And if this gets accepted, remove 'global' in 3.0. > In 3.0 we could remove 'global' even without 'outer', and make module global scopes read

Re: [Python-Dev] PEP for Better Control of Nested Lexical Scopes

2006-02-22 Thread Samuele Pedroni
Almann T. Goo wrote: >>As far as I remember, Guido wasn't particularly opposed >>to the idea, but the discussion fizzled out after having >>failed to reach a consensus on an obviously right way >>to go about it. > > > My apologies for bringing this debated topic again to the > front-lines--that s

Re: [Python-Dev] Draft proposal: Implicit self in Python 3.0

2006-01-08 Thread Samuele Pedroni
Ian Bicking wrote: > I just don't want people to feel discouraged when they try to contribute > to the Python community and a PEP 13 could help direct people towards > areas where their contributions are more likely to be useful. but people have a lot of options, probably more effective, rangin

Re: [Python-Dev] Draft proposal: Implicit self in Python 3.0

2006-01-08 Thread Samuele Pedroni
Ian Bicking wrote: > Tim Peters wrote: > >>[Thomas Wouters] >> >> >>>My point isn't that it isn't archived somewhere (mailinglists, wiki, FAQ, >>>the minds of many, many people, not just Python developers) but that it >>>isn't easily findable and it isn't easily accessible in a single location. I

Re: [Python-Dev] Draft proposal: Implicit self in Python 3.0

2006-01-08 Thread Samuele Pedroni
Ralf W. Grosse-Kunstleve wrote: > --- Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >>>Please try the code below to see the performance impact. >> >>oh, please. do you seriously think that if you don't have to type "self" >>yourself, Python will suddenly be able to turn all instance variables into >

[Python-Dev] some interesting readings

2006-01-07 Thread Samuele Pedroni
because I was reminded of them recently, because they may be useful landmarks in the prospective of future discussions, because expanding one's understanding of the problem/solution space of language design is quite a good thing if one is interested in such things... 1) Gilad Bracha. Pluggable T

Re: [Python-Dev] a quit that actually quits

2005-12-30 Thread Samuele Pedroni
Nick Coghlan wrote: > Samuele Pedroni wrote: > >>Michael Chermside wrote: >> >>>The F-bot writes: >>> >>> >>>>in reality, some things are carefully thought out and craftily im- >>>>plemented, some things are engineering tra

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Samuele Pedroni
Michael Chermside wrote: > The F-bot writes: > >>in reality, some things are carefully thought out and craftily im- >>plemented, some things are engineering tradeoffs made at a certain time, >>and some things are just accidents -- but python-dev will happily defend >>the current solution with the

Re: [Python-Dev] a quit that actually quits

2005-12-28 Thread Samuele Pedroni
Michael Hudson wrote: > [EMAIL PROTECTED] writes: > > >>Fredrik> a quit/exit command that actually quits, instead of printing a >>Fredrik> "you didn't say please!" message. >> >>I like Fredrik's idea more and more. > > > The thing that bothers me about it is that the standard way you te

Re: [Python-Dev] status of development documentation

2005-12-24 Thread Samuele Pedroni
Tim Peters wrote: > [Neal] > >>Hmmm, I thought others were running the tests on Windows too. There >>was one report on Nov 22 about running Purify on Windows 2k (subject: >>ast status, memory leaks, etc). He had problems with a stack overflow >>in test_compile. He was going to disable the test

[Python-Dev] Next PyPy Sprint: Palma de Mallorca (Spain) 23rd - 29th January 2006

2005-12-21 Thread Samuele Pedroni
Palma de Mallorca PyPy Sprint: 23rd - 29th January 2006 The next PyPy sprint is scheduled to take place January 2006 in Palma De Mallorca, Balearic Isles, Spain. We'll give newcomer-friendly introductions and the focus will mainly

Re: [Python-Dev] For Python 3k, drop default/implicit hash, and comparison

2005-11-26 Thread Samuele Pedroni
Noam Raphael wrote: > Three weeks ago, I read this and thought, "well, you have two options > for a default comparison, one based on identity and one on value, both > are useful sometimes and Guido prefers identity, and it's OK." But > today I understood that I still think otherwise. > well, this

Re: [Python-Dev] Why should the default hash(x) == id(x)?

2005-11-05 Thread Samuele Pedroni
Noam Raphael wrote: > On 11/5/05, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >>More generally, I claim that the current behaviour is better than >>*any* alternative. To refute this claim, you would have to come >>up with an alternative first. >> > > The alternative is to drop the __hash__ met

Re: [Python-Dev] a different kind of reduce...

2005-11-01 Thread Samuele Pedroni
Reinhold Birkenfeld wrote: > Raymond Hettinger wrote: > >>[Martin Blais] >> I'm always--literally every time-- looking for a more functional >> >>form, >> something that would be like this: # apply dirname() 3 times on its results, initializing with p ... = repapply(dirn

Re: [Python-Dev] AST branch is in?

2005-10-25 Thread Samuele Pedroni
Guido van Rossum wrote: > On 10/25/05, Frank Wierzbicki <[EMAIL PROTECTED]> wrote: > >> My name is Frank Wierzbicki and I'm working on the Jython project. Does >>anyone on this list know more about the history of this Grammar sharing >>between the two projects? I've heard about some Grammar shar

Re: [Python-Dev] [Jython-dev] Re: AST branch is in?

2005-10-25 Thread Samuele Pedroni
Frank Wierzbicki wrote: > On 10/20/05, *Neal Norwitz* <[EMAIL PROTECTED] > > wrote: > > The Grammar is (was at one point at least) shared between Jython and > would allow more tools to be able to share infrastructure. The idea > is to eventually be able to h

Re: [Python-Dev] Deprecating builtin id (and moving it to sys())

2005-08-17 Thread Samuele Pedroni
Jeremy Hylton wrote: > I'd like to see the builtin id() removed so that I can use it as a > local variable name without clashing with the builtin name. I > certainly use the id() function, but not as often as I have a local > variable I'd like to name id. The sys module seems like a natural > pla

Re: [Python-Dev] __traceback__ and reference cycles

2005-08-09 Thread Samuele Pedroni
Tim Peters wrote: > > I can't think of a Python feature with a higher aggregate > braincell_burned / benefit ratio than __del__ methods. If P3K retains > them-- or maybe even before --we should consider taking "the Java > dodge" on this one. That is, decree that henceforth a __del__ method > wil

[Python-Dev] Next PyPy sprint: Heidelberg (Germany), 22nd-29th of August

2005-07-30 Thread Samuele Pedroni
nfo/heidelberg-people.html .. _`PyPy sprint mailing list`: http://codespeak.net/mailman/listinfo/pypy-sprint -- Samuele Pedroni & the PyPy team ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

[Python-Dev] Python Language track at Europython, still possibilities to submit talks

2005-05-04 Thread Samuele Pedroni
python.org/sections/tracks_and_talks/propose_a_talk/ http://www.europython.org Regards, Samuele Pedroni, Python Language Track chair. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] Re: anonymous blocks

2005-04-28 Thread Samuele Pedroni
Greg Ewing wrote: Guido van Rossum wrote: And surely you exaggerate. How about this then: The with-statement is similar to the for-loop. Until you've learned about the differences in detail, the only time you should write a with-statement is when the documentation for the function

Re: [Python-Dev] Re: anonymous blocks

2005-04-27 Thread Samuele Pedroni
Jim Fulton wrote: Duncan Booth wrote: Jim Fulton <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: Guido van Rossum wrote: I've written a PEP about this topic. It's PEP 340: Anonymous Block Statements (http://python.org/peps/pep-0340.html). Some observations: 1. It looks to me like a bare retur

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Samuele Pedroni
Michael Hudson wrote: The history of iterators and generators could be summarized by saying that an API was invented, then it turned out that in practice one way of implementing them -- generators -- was almost universally useful. This proposal seems a bit like an effort to make generators good

Re: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-25 Thread Samuele Pedroni
Robert Brewer wrote: Shane Hathaway wrote: Robert Brewer wrote: So currently, all subclasses just override __set__, which leads to a *lot* of duplication of code. If I could write the base class' __set__ to call "macros" like this: def __set__(self, unit, value): self.begin() if s

Re: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-25 Thread Samuele Pedroni
Michael Chermside wrote: Jim Jewett writes: As best I can tell, the anonymous blocks are used to take care of boilerplate code without changing the scope -- exactly what macros are used for. Folks, I think that Jim is onto something here. I've been following this conversation, and it sounds

Re: [Python-Dev] anonymous blocks

2005-04-21 Thread Samuele Pedroni
Guido van Rossum wrote: [Brett] I think I agree with Samuele that it would be more pertinent to put all of this effort into trying to come up with some way to handle cleanup in a generator. I.e. PEP 325. But (as I explained, and you agree) that still doesn't render PEP 310 unnecessary, because abu

Re: [Python-Dev] Re: Re: anonymous blocks

2005-04-21 Thread Samuele Pedroni
Fredrik Lundh wrote: Regardless, I believe that solving generator finalization (calling all enclosing finally blocks in the generator) is a worthwhile problem to solve. Whether that be by PEP 325, 288, 325+288, etc., that should be discussed. Whether people use it as a pseudo-block, or decide tha

Re: [Python-Dev] Re: switch statement

2005-04-21 Thread Samuele Pedroni
Michael Hudson wrote: Shannon -jj Behrens <[EMAIL PROTECTED]> writes: On 4/20/05, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: My use case for switch is that of a parser switching on tokens. mxTextTools applications would greatly benefit from being able to branch on tokens quickly. Currently, t

Re: [Python-Dev] Re: anonymous blocks

2005-04-20 Thread Samuele Pedroni
def do(): print "setup" try: yield None finally: print "tear down" doesn't quite work (if it did, all you would need is syntactic sugar for "for dummy in"). PEP325 is about that ___ Python-Dev mailing list

Re: [Python-Dev] Security capabilities in Python

2005-04-09 Thread Samuele Pedroni
Ka-Ping Yee wrote: On Sat, 9 Apr 2005, Jp Calderone wrote: Does using the gc module to bypass this security count? If so: [EMAIL PROTECTED]:~$ python -i facet.py >>> import gc >>> c = readonly_facet.__getattr__.func_closure[1] >>> r = gc.get_referents(c)[0] >>> r.n = 'hax0r3d' >

Re: [Python-Dev] Pickling instances of nested classes

2005-04-01 Thread Samuele Pedroni
Walter Dörwald wrote: Samuele Pedroni wrote: [...] And having the full name of the class available would certainly help in debugging. that's probably the only plus point but the names would be confusing wrt modules vs. classes. You'd propably need a different separator in repr. XIST

Re: [Python-Dev] Pickling instances of nested classes

2005-03-31 Thread Samuele Pedroni
Walter Dörwald wrote: Samuele Pedroni wrote: Walter Dörwald wrote: [User cases for pickling instances of nested classes] So is this change wanted? useful? implementable with reasonable effort? Or just not worth it? notice that in this cases often metaclasses are involved or could easely be, so

Re: [Python-Dev] Pickling instances of nested classes

2005-03-29 Thread Samuele Pedroni
Walter Dörwald wrote: For XML: 1) Those classes are the element types and the nested classes are the attributes. 2) Being able to define those attributes as separate classes makes it possible to implement custom functionality (e.g. for validation or for handling certain attribute types like URLs, c

Re: [Python-Dev] thread semantics for file objects

2005-03-17 Thread Samuele Pedroni
Jeremy Hylton wrote: On Thu, 17 Mar 2005 16:25:44 -0500, Aahz <[EMAIL PROTECTED]> wrote: On Thu, Mar 17, 2005, Jeremy Hylton wrote: Are the thread semantics for file objecst documented anywhere? I don't see anything in the library manual, which is where I expected to find it. It looks like read a

Re: [Python-Dev] code blocks using 'for' loops and generators

2005-03-16 Thread Samuele Pedroni
Josiah Carlson wrote: Greg Ewing <[EMAIL PROTECTED]> wrote: Josiah Carlson wrote: Since PEP 310 was already mentioned, can we just say that the discussion can be boiled down to different ways of spelling __enter__/__exit__ from PEP 310? It's not quite the same thing. PEP 310 suggests a mechanism w

Re: [Python-Dev] RE: code blocks using 'for' loops and generators

2005-03-15 Thread Samuele Pedroni
Jim Jewett wrote: It may be time to PEP (or re-PEP), if only to clarify what people are actually asking for. Brian Sabbey's example from message http://mail.python.org/pipermail/python-dev/2005-March/052202.html *seems* reasonably clear, but I don't see how it relates in any way to "for" loops o

Re: [Python-Dev] code blocks using 'for' loops and generators

2005-03-15 Thread Samuele Pedroni
Brian Sabbey wrote: Samuele Pedroni wrote: OTOH a suite-based syntax for thunks can likely not work as a substitute of lambda for cases like: f(lambda: ..., ...) where the function is the first argument, and then there are further arguments. I do not see why you say suite-based thunks cannot

Re: [Python-Dev] code blocks using 'for' loops and generators

2005-03-14 Thread Samuele Pedroni
Brian Sabbey wrote: be guaranteed to run under all conditions, I think it would be useful if it could be arranged so that for x in somegenerator(): ... raise Blather ... would caused any finallies that the generator was suspended inside to be executed. Then the semantics would be the same as if the

Re: [Python-Dev] Adding any() and all()

2005-03-11 Thread Samuele Pedroni
Peter Astrand wrote: On Fri, 11 Mar 2005, Paul Moore wrote: Not sure this is pertinent but anyway: "any" and "all" are often used as variable names. "all" especially often and then almost always as a list of something. It would not be good to add "all" to the list of words to watch out for. Also

Re: [Python-Dev] PEP 309 enhancements

2005-02-27 Thread Samuele Pedroni
Nick Coghlan wrote: The initial suggestion was to provide a __get__ method on partial objects, which forces the insertion of the reference to self at the beginning of the argument list instead of at the end: def __get__(self, obj, type=None): if obj is None: return self

Re: [Python-Dev] 2.4 news reaches interesting places

2004-12-18 Thread Samuele Pedroni
Guido van Rossum wrote: I was pleasantly surprised to find a pointer to this article in a news digest that the ACM emails me regularly (ACM TechNews). http://gcn.com/vol1_no1/daily-updates/28026-1.html One thing that bugs me: the article says 3 or 4 times that Python is slow, each time with a refut