Skip to content

Instantly share code, notes, and snippets.


Guido van Rossum gvanrossum

Block or report user

Report or block gvanrossum

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:d01545734b65d6f0676dfbcb13a8ceac
Hello Dear,
This is Ellen from ***.com
We are pleased to get to know that your articles on your blog are awesome and the writing style is so suitable for introducing our company's products.
And we sincerely invite you to cooperate with us,
*Write an article about our products on your blog about 400-500 words + 2 pictures+ 3 links
*Promote it on your social website.
View fix.diff
diff --git a/mypy/ b/mypy/
index 7b0180f79..488ae825f 100644
--- a/mypy/
+++ b/mypy/
@@ -991,9 +991,11 @@ class TypeChecker(NodeVisitor[None], CheckerPluginInterface):
if is_unsafe_overlapping_signatures(forward_tweaked,
+ rev_name = if reverse_class is not None else None
+ fwd_name = if forward_base and hasattr(forward_base, 'type ') and forward_base.type else None
gvanrossum / output.txt
Created May 16, 2017
Variadic decorator
View output.txt error: Overloaded function signatures 1 and 2 overlap with incompatible return types error: Overloaded function signatures 1 and 3 overlap with incompatible return types error: Revealed type is 'Any' error: Revealed type is 'Any'
gvanrossum /
Last active Oct 27, 2019
Expand variadic type variables
BOUND = 'object'
def prelude(limit: int, bound: str) -> None:
print('from typing import Callable, Iterable, Iterator, Tuple, TypeVar, overload')
print('Ts = TypeVar(\'Ts\', bound={bound})'.format(bound=bound))
print('R = TypeVar(\'R\')')
for i in range(LIMIT):
print('T{i} = TypeVar(\'T{i}\', bound={bound})'.format(i=i+1, bound=bound))
gvanrossum /
Last active May 29, 2019
local timezone class
# A local timezone class that inherits its behavior from the time
# module's knowledge about the local time zone.
# TODO: Use tm_gmtoff and tm_zone if supported? (Probably should be a
# separate class so we can compare them.)
import calendar # TODO: Really shouldn't.
import datetime
import time
View gist:c669398c67386e9fb43e

This was posted as an email to python-dev.

History lesson

Since I signed up for the python-dev mailing list way back in June 2002, there seems to be a cycle where we as a group come to a realization that our current software development process has not kept up with modern practices and could stand for an update. For me this was first shown when we moved from SourceForge to our own infrastructure, then again when we moved from Subversion to Mercurial (I led both of these initiatives, so it's somewhat a tradition/curse I find myself in this position yet again). And so we again find ourselves at the point of realizing that we are not keeping up with current practices and thus need to evaluate how we can improve our situation.

Where we are now

Now it should be realized that we have two sets of users of our development process: contributors and core developers (the latter whom can play both roles). If you take a rough outline of our cu

gvanrossum / output
Last active Aug 29, 2015
Transaction example
View output
main: i = 0
and a bottle of rum 0
import sys
import time
def g1(depth):
if depth > 0:
it = g1(depth-1)
yield next(it)
import asyncio
END = b'Bye-bye!\n'
def echo_client():
reader, writer = yield from asyncio.open_connection('localhost', 8000)
writer.write(b'Hello, world\n')
writer.write(b'What a fine day it is.\n')
You can’t perform that action at this time.