| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
timeout socket patch design.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While I was at it, I added a tp_clear handler and changed the
tp_dealloc handler to use the clear_slots helper for the tp_clear
handler.
Also tightened the rules for slot names: they must now be proper
identifiers (ignoring the dirty little fact that <ctype.h> is locale
sensitive).
Also set mp->flags = READONLY for the __weakref__ pseudo-slot.
Most of this is a 2.2 bugfix candidate; I'll apply it there myself.
|
| |
|
|
|
|
| |
Make Tkinter.TclError derive from Exception, it was a string.
|
|
|
|
|
|
|
|
|
|
| |
BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
big endian systems.
The old names BOM32_* and BOM64_* were off by a factor of 2.
This closes SF bug http://www.python.org/sf/555360
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the module constructor (module_init) to have the signature
__init__(name:str, doc=None); this prevents the call from type_new()
to succeed. While we're at it, prevent repeated calling of
module_init for the same module from leaking the dict, changing the
semantics so that __dict__ is only initialized if NULL.
Also adding a unittest, test_module.py.
This is an incompatibility with 2.2, if anybody was instantiating the
module class before, their argument list was probably empty; so this
can't be backported to 2.2.x.
|
| |
|
| |
|
|
|
|
| |
Now we just need to make sure people know about it...
|
| |
|
|
|
|
|
| |
that are in the process of deprecation (PendingDeprecationWarning).
Docs could be improved.
|
|
|
|
|
|
|
| |
[ 559250 ] more POSIX signal stuff
Adds support (and docs and tests and autoconfery) for posix signal
mask handling -- sigpending, sigprocmask and sigsuspend.
|
|
|
|
|
|
|
| |
for 'str' and 'unicode', and can be used instead of
types.StringTypes, e.g. to test whether something is "a string":
isinstance(x, string) is True for Unicode and 8-bit strings. This
is an abstract base class and cannot be instantiated directly.
|
|
|
|
| |
"power" was formally ambiguous. Here's his fix.
|
|
|
|
|
| |
string with text in column zero. Skip that stuff when looking for the
"first statement following the statement containing point".
|
| |
|
| |
|
|
|
|
| |
for his service on the Python-Help maillist.
|
| |
|
|
|
|
|
| |
save-excursion so that when the function is complete, point is
preserved.
|
| |
|
| |
|
|
|
|
| |
pymalloc?
|
| |
|
|
|
|
|
| |
Avoid checks for negative indices and duplicate checks for support of
the sequence protocol.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
and the .seed() and .whseed() methods failed to reset it. In other
words, setting the seed didn't completely determine the sequence of
results produced by random.gauss(). It does now. Programs repeatedly
mixing calls to a seed method with calls to gauss() may see different
results now.
Bugfix candidate (random.gauss() has always been broken in this way),
despite that it may change results.
|
| |
|
| |
|
| |
|
|
|
|
| |
define info-lookup-maybe-add-help.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This now does a dynamic analysis of which elements are so frequently
repeated as to constitute noise. The primary benefit is an enormous
speedup in find_longest_match, as the innermost loop can have factors
of 100s less potential matches to worry about, in cases where the
sequences have many duplicate elements. In effect, this zooms in on
sequences of non-ubiquitous elements now.
While I like what I've seen of the effects so far, I still consider
this experimental. Please give it a try!
|
| |
|
|
|
|
|
| |
enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
The argument can be an arbitrary iterable object.
|
|
|
|
|
| |
the `when' condition so other non-Python shell comint changes won't
cause random buffers to pop.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
left and right type were of the same type and not classic instances.
This shortcut is dangerous for proxy types, because it means that
coerce(Proxy(1), Proxy(2.1)) leaves Proxy(1) unchanged rather than
turning it into Proxy(1.0).
In an ever-so-slight change of semantics, I now only take the shortcut
when the left and right types are of the same type and don't have the
CHECKTYPES feature. It so happens that classic instances have this
flag, so the shortcut is still skipped in this case (i.e. nothing
changes for classic instances). Proxies also have this flag set
(otherwise implementing numeric operations on proxies would become
nightmarish) and this means that the shortcut is also skipped there,
as desired. It so happens that int, long and float also have this
flag set; that means that e.g. coerce(1, 1) will now invoke
int_coerce(). This is fine: int_coerce() can deal with this, and I'm
not worried about the performance; int_coerce() is only invoked when
the user explicitly calls coerce(), which should be rarer than rare.
|
|
|
|
| |
test __debug__ at runtime. Closes SF patch #548833.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
better auto-recognition of a Jython file vs. a CPython (or agnostic)
file by looking at the #! line more closely, and inspecting the import
statements in the first 20000 bytes (configurable). Specifically,
(py-import-check-point-max): New variable, controlling how far into
the buffer it will search for import statements.
(py-jpython-packages): List of package names that are Jython-ish.
(py-shell-alist): List of #! line programs and the modes associated
with them.
(jpython-mode-hook): Extra hook that runs when entering jpython-mode
(what about Jython mode? <20k wink>).
(py-choose-shell-by-shebang, py-choose-shell-by-import,
py-choose-shell): New functions.
(python-mode): Use py-choose-shell.
(jpython-mode): New command.
(py-execute-region): Don't use my previous hacky attempt at doing
this, use the new py-choose-shell function.
One other thing this file now does: it attempts to add the proper
hooks to interpreter-mode-alist and auto-mode-alist if they aren't
already there. Might help with Emacs users since that editor doesn't
come with python-mode by default.
|
|
|
|
|
| |
whitespace can hose the needs-if test. So just skip all blank lines
at the start of the region right off the bat.
|
|
|
|
|
| |
always get to see the result of e.g. a py-execute-region. Funny, this
bugged both me /and/ Guido!
|
|
|
|
|
|
|
|
|
| |
Allows for some customization of the underlying comint buffer.
(py-shell): Call the new hook.
(info-lookup-maybe-add-help): A new call suggested by Milan Zamazal to
make lookups in the Info documentation easier.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
closes SF #514433
can now pass 'None' as the filename for the bsddb.*open functions,
and you'll get an in-memory temporary store.
docs are ripped out of the bsddb dbopen man page. Fred may want to
clean them up.
Considering this for 2.2, but not 2.1.
|
|
|
|
|
|
|
|
| |
(py-mode-map): Bind py-help-at-point to f1 as well as C-c C-h
(py-help-at-point): Make sure the symbol is quoted so things like
pydoc.help('sys.platform') work correctly. Also, leave the *Python
Output* buffer in help-mode; this may be a bit more controversial.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to call pychecker on the current file, add a face for pseudo
keywords self, None, True, False, and Ellipsis. Specifically,
(py-pychecker-command, py-pychecker-command-args): New variables.
(py-pseudo-keyword-face): New face variable, defaulting to a copy of
font-lock-keyword-face.
(python-font-lock-keywords): Add an entry for self, None, True, False,
Ellipsis to be rendered in py-pseudo-keyword-face.
(py-pychecker-history): New variable.
(py-mode-map): Bind C-c C-w to py-pychecker-run.
(py-pychecker-run): New command.
|